开发者

How to open "file://D:/help.html#selclass" with default browser in C# [duplicate]

This question already has answers here: 开发者_JAVA百科 Closed 11 years ago.

Possible Duplicate:

How to open in default browser in C#

How to open "file://D:/help.html#selclass" with default browser in C#, is there any example?

Thanks Dma


Process.Start("file://D:/help.html#selclass");


var p = Process.Start(@"D:\help.html");
while (!p.HasExited) Thread.Sleep(10);

// carry on


You could:

  1. Create a temporary .URL file (see here for instance) that features #selclass in the URL.
  2. Open the .URL using Process.Start(...).
  3. Delete the temporary .URL file.


I got default browser firstly through register table; and then call

Process.Start(browser, url);

It works

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜