How does one load a URL from a .NET client application
Question
What is the preferred way to open a URL from a thick client application on Windows using C# and the .NET framework? I want it to use the default browser.
Solution
The following code surely works:
Process.Start("http://www.yoururl.com/Blah.aspx");
It opens the default browser (technically, the default program that handles HTTP URIs).
OTHER TIPS
I'd use the Process.Start method.
Process.Start("http://www.google.com/");
private void launchURL_Click(object sender, System.EventArgs e){
string targetURL = "http://stackoverflow.com";
System.Diagnostics.Process.Start(targetURL);
}
System.Diagnostics.Process.Start("http://www.stackoverflow.com");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow