Open a URL in the Default Browser in Your .NET Application

Contributor Icon Contributed by johnnythawte  
Tag Icon Tagged: C programming  

Virtually every application these days requires at least some connection to the internet. Letting the user click a link and open it in their browser is essential. This recipe shows you the 1 line method of doing so.


This is the absolute simplest way to launch a URL in a .NET application:
System.Diagnostics.Process.Start("http://www.tech-recipes.com");

Just put this code in the click event for your control, and replace the URL in the sample code with your URL.

 

4 Comments -


  1. moises said on June 11, 2009

    thanks!!

  2. Anonymous said on May 30, 2010

    Awesome, thanks for this!

  3. mohammad said on December 27, 2010

    thanks v.v.v.v.v.v.v.v.thanks

  4. ronnie said on March 11, 2011

    is possible to pass post data in opening web browser?

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -