Read the default browser executable file path from the registry
Private voidButton1_Click (Objectsender, EventArgs e) { //read the default browser executable file path from the registryRegistryKey key = Registry.ClassesRoot.OpenSubKey (@"http\shell\open\command\"); strings = 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"); }
Call IE browser
Private void button4_click (object sender, EventArgs e) { // call IE browser System.Diagnostics.Process.Start ("iexplore.exe"" HTTP://BLOG.CSDN.NET/TESTCS_DN"); }
Invoking the system's default browser
Private void button3_click (object sender, EventArgs e) { // System.Diagnostics.Process.Start ("http://blog.csdn.net/testcs_dn"); }
C # invoke browser to open web page