Solved

How can I open a URL with the default browser?

Posted on 2007-11-16
2
178 Views
Last Modified: 2013-12-17
The title says it all.
0
Comment
Question by:EEssam
2 Comments
 
LVL 16

Accepted Solution

by:
McExp earned 350 total points
Comment Utility
The following code works for me, it is the click event of a button handler, when the button is clicked the browser is loaded.

private void Button1_Click(Object sender, EventArgs e)
{
Process.Start("http://www.experts-exchange.com/Microsoft/Development/.NET/.NET_Framework_2.0/Q__22966731.html");
}
0
 
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 150 total points
Comment Utility
Process.Start can cause an exception, use a try/catch block

    string url= "http://www.google.com";
    try
        {
         System.Diagnostics.Process.Start(url);
        }
   catch
        {
             // do something
        }
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now