This code will allow you to launch the default browser on the system and open an URL.
To do this we need to retrieve the path of
default browser from windows registry, then we launch a process with the link as argument :
using System.Diagnostics;
using System.IO;
using Microsoft.Win32;
private void OpenURL(string url)
{
string key = @"htmlfile\shell\open\command";
RegistryKey registryKey = Registry.ClassesRoot.OpenSubKey(key, false);
// Get the default browser path on the system
string Default_Browser_Path = ((string)registryKey.GetValue(null, null)).Split('"')[1];
Process p = new Process();
p.StartInfo.FileName = Default_Browser_Path;
p.StartInfo.Arguments = url;
p.Start();
}
private void button1_Click(object sender, EventArgs e)
{
OpenURL("http://www.codicode.com");
}