Reputation:
How to invoke the default browser with an URL from C#?
Upvotes: 10
Views: 1189
Reputation: 63163
I used System.Diagnostics.Process.Start in the past, but if Firefox or another browser is set as the default this method always throws a terrible exception to users. At last, I come across System.Windows.Forms.Help.ShowHelp
Help.ShowHelp(null, "http://www.google.com");
Please notice that Help is a class only available for WinForms, while Process can be used for other cases (WebForms, WPF and so on).
Upvotes: 2
Reputation: 457
System.Diagnostics.Process.Start("http://www.google.com");
More details here - http://msdn.microsoft.com/en-us/library/aa326951.aspx
Upvotes: 18
Reputation: 827286
System.Diagnostics.Process.Start("http://mysite.com");
Upvotes: 6