I want to make my WPF application open the default browser and go to a certain web page. How do I do that?
See Question&Answers more detail:osI want to make my WPF application open the default browser and go to a certain web page. How do I do that?
See Question&Answers more detail:osFor desktop versions of .NET:
System.Diagnostics.Process.Start("http://www.webpage.com");
For .NET Core, the default for ProcessStartInfo.UseShellExecute
has changed from true
to false
, and so you have to explicitly set it to true
for this to work:
System.Diagnostics.Process.Start(new ProcessStartInfo
{
FileName = "http://www.webpage.com",
UseShellExecute = true
});
To further complicate matters, this property cannot be set to true
for UWP apps (so none of these solutions are usable for UWP).