Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
894 views
in Technique[技术] by (71.8m points)

.net - How to launch MS Edge from c# winforms?

The executable MicrosoftEdge.exe cannot be launched directly like other EXEs in windows. I confirmed that from my own experience, and by reading this and that.

I also cannot launch it via Process.Start("MicrosoftEdge.exe") in my c# winforms app.

There must be some way to launch Edge from winforms without resorting to 3rd-party app and other clutter. I have already tried the following, with no success:

  1. Process.Start("MicrosoftEdge.exe") - unhandled exception
  2. Process.Start("microsoft-edge") - unhandled exception
  3. Process.Start("%windir%explorer.exe shell:AppsfolderMicrosoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge") - unhandled exception
  4. Process.Start(@"c:WindowsSystemAppsMicrosoft.MicrosoftEdge_8wekyb3d8bbweMicrosoftEdge.exe") - no exception, but nothing happens

Note: I can easily launch Chrome and Firefox using method #1 above.

How can I launch MS Edge from my .net winforms app?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The ":" at the end is inportant, otherwise won't work

To open in blank:

System.Diagnostics.Process.Start("microsoft-edge:");

or specifying an address:

System.Diagnostics.Process.Start("microsoft-edge:http://www.google.com");

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...