Kendall's Online blog

Monday, May 26, 2008

Open a web page in C# using your default browser

Below is a code snippet to open a web page using C#
The input to the function is the url of the page to open.

private void OpenPage(string url)
{
try
{
System.Diagnostics.Process.Start(url);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}