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

Posted December 11, 2006 by johnnythawte in 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:

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

The Conversation

Follow the reactions below and share your own thoughts.

  • moises


  • Anonymous

    Awesome, thanks for this!

  • mohammad

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

  • ronnie

    is possible to pass post data in opening web browser?

  • madhab kumar

    I love my eyes when U look into them,
    I love my name when U say it, from- madhab kumar , sana aryapalli

  • Sau Hi

    How can I open a link with chosen browser. EX: Open link with Firefox but my default browser on computer is IE?