By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,959 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,959 IT Pros & Developers. It's quick & easy.

Codebase/htmlHelp files problem

P: n/a
I seem to have a small problem using html help files in .NET.

I created a program.chm file, and this one is located at the same location
of the .NET program.exe.

So I want to use following code top point to my help file:
Assembly myAssembly = Assembly.GetExecutingAssembly();
string sCodeBase=myAssembly.CodeBase;
mHelpFile=Path.ChangeExtension(sCodeBase,"chm");

And use it like this:
helpProvider1.HelpNamespace=mHelpFile;

Help.ShowHelp(this,mHelpFile,HelpNavigator.TableOf Contents);
Help.ShowHelpIndex(this, mHelpFile);

Now comes the funny thing:

mHelpFile turns out to be something like this:
"file://D:/MyPath/program.chm"
Note the "file://" part!!!!

If I use winhlp files "file://D:/MyPath/program.hlp" then this works fine
but if I use the html v1.xx help files "file://D:/MyPath/program.chm" then
this does not show!
But if I remove the "file://" and have "D:/MyPath/program.chm" then it
works fine!

Does anyone know how to detect and extract this "file://" part?
The Path class does not seem to have a method to extract the "xxxx://"
parts.
I could create my own method but I prefer to use the .NET functions.


Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
>....
mHelpFile turns out to be something like this:
"file://D:/MyPath/program.chm"
Note the "file://" part!!!!

If I use winhlp files "file://D:/MyPath/program.hlp" then this works fine
but if I use the html v1.xx help files "file://D:/MyPath/program.chm" then this does not show!
But if I remove the "file://" and have "D:/MyPath/program.chm" then it
works fine!

Does anyone know how to detect and extract this "file://" part?
The Path class does not seem to have a method to extract the "xxxx://"
parts.


I have current not so nice fix that works:

Assembly myAssembly = Assembly.GetExecutingAssembly();
mHelpFile=myAssembly.CodeBase;
if (mHelpFile.ToLower().StartsWith("file:///")) {
mHelpFile=mHelpFile.Substring(8,mHelpFile.Length-8);
}
mHelpFile=Path.ChangeExtension(mHelpFile,"chm");
helpProvider1.HelpNamespace=mHelpFile;
I someone have a better sulution, please tell me. :-)
Jul 21 '05 #2

P: n/a
A new problem has emerged:

helpProvider1.HelpNamespace="\\Myserver/program files/skyscan/test.chm"

It doesn't want to open my help file if I use "\\Myserver"
It does open it if I have a drive mapping "q:/program
files/skyscan/test.chm"

Anyone have a sollution for this?
Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.