0

I need to open a URL that has a "#" inside using the default browser. I use

System.Diagnostics.Process.Start("file:///c:\Projects\HTMLTest\Debug\help\index.htm#Modules\Administration\UserInterface\MainWindow\Processing.htm");

Now when the browser is launched but the URL it receives is

file:///c:\Projects\HTMLTest\Debug\help\index.htm

Everything after and including the # is cut off. What can I do to open the complete URL in the browser?

Daniel
  • 1,391
  • 2
  • 19
  • 40
  • of course, the part after `#` is **invalid**, the part after `#` should be name of some `HTML Anchor tag` in the `index.html` – King King Oct 11 '13 at 09:45

1 Answers1

1

You can get path of executable of default browser from registry (look at the following answer for example: https://stackoverflow.com/a/17599201/2870402) and create new process passing the URL as the parameter:

string pathToExecutable = ...;
string url = @"file:///c:\Projects\HTMLTest\Debug\help\index.htm#Modules\Administration\UserInterface\MainWindow\Processing.htm";
System.Diagnostics.Process.Start(pathToExecutable, url);
Community
  • 1
  • 1
vers
  • 622
  • 2
  • 9
  • 21