private void Button1_Click (object sender, EventArgs e)
{
Read the default browser executable file path from the registry
RegistryKey key = Registry.ClassesRoot.OpenSubKey (@ "http\shell\open\command\");
string s = key. GetValue (""). ToString ();
S is your default browser, but with the parameters behind it, cut it, but note that the parameters behind the different browsers are not the same!
"D:\Program Files (x86) \google\chrome\application\chrome.exe"--"%1"
System.Diagnostics.Process.Start (s.substring (0, s.length-8), "http://blog.csdn.net/testcs_dn");
}
private void Button2_Click (object sender, EventArgs e)
{
Invoking the system's default browser
System.Diagnostics.Process.Start ("Explorer.exe", "http://blog.csdn.net/testcs_dn");
}
private void Button3_Click (object sender, EventArgs e)
{
Invoking the system's default browser
System.Diagnostics.Process.Start ("http://blog.csdn.net/testcs_dn");
}
private void Button4_Click (object sender, EventArgs e)
{
Call IE browser
System.Diagnostics.Process.Start ("Iexplore.exe", "http://blog.csdn.net/testcs_dn");
}
C # Several ways to invoke the default browser to open a Web page