views:

265

answers:

4

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.

+4  A: 

I'd use the Process.Start method.

Process.Start("http://www.google.com/");
Mudu
+1  A: 
private void launchURL_Click(object sender, System.EventArgs e){
 string targetURL = "http://stackoverflow.com";
 System.Diagnostics.Process.Start(targetURL);
}
Martin
A: 
System.Diagnostics.Process.Start("http://www.stackoverflow.com");
Bullines
+6  A: 

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).

Dario Solera