Opening a URL in the default browser in a Windows 8 desktop application

前端 未结 2 478
南方客
南方客 2021-01-02 01:32

I am using System.Diagnostics.Process.Start from a desktop application to start the default browser to visit a link, as below. This is using C# with .NET 4.0 o

相关标签:
2条回答
  • 2021-01-02 01:55

    For WinRT apps only, it's simply

    Launcher.LaunchUriAsync(new Uri("http://www.google.com"));
    

    Take a look here.

    0 讨论(0)
  • 2021-01-02 02:12

    It seems that you need to specify the process name under Win8. The answer below comes from Armin's answer here.

    var startInfo = new ProcessStartInfo("explorer.exe", @"http://www.google.com");
    Process.Start(startInfo);
    
    0 讨论(0)
提交回复
热议问题