Process.Start to open an URL, getting an Exception?

前端 未结 4 648
慢半拍i
慢半拍i 2020-12-06 05:56

I\'m trying to open an URL following a simple method written all over google and even MSDN. But for unknown reasons I get an Exception as follows:

Win32Except         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-06 06:48

    I had a similar issue trying this with .NET Core and getting a Win32Exception, I dealt with it like so:

    var ps = new ProcessStartInfo("http://myurl")
    { 
        UseShellExecute = true, 
        Verb = "open" 
    };
    Process.Start(ps);
    

提交回复
热议问题