For 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).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…