Hi,

I have created an html help file for my application and have a menu button to open it but I am having problems as it keeps coming up with an error saying it can't find the file.

I don't want to hard code the full path to the help file as this may var on each users PC.

Here is the code to open the file:-

void MenuHelpClick(object sender, EventArgs e)
		 {
            System.Diagnostics.Process.Start("iexplorer.exe", "helpFile.html");
        }

How can I code this so as it finds the help file within the applications folder?

Regards..,

MT

Recommended Answers

All 2 Replies

You can use Application.StartupPath:

System.Diagnostics.Process.Start("iexplore.exe", System.IO.Path.Combine(Application.StartupPath, "abc.html"));

Thanks

You can use Application.StartupPath:

System.Diagnostics.Process.Start("iexplore.exe", System.IO.Path.Combine(Application.StartupPath, "abc.html"));

Thanks

Thank you..,

MT

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.