开发者

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

开发者 https://www.devze.com 2023-02-20 00:26 出处:网络
This question already has answers here: 开发者_JAVA百科 Closed 11 years ago. Possible Duplicate: How to open in default browser in C#
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

精彩评论

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