废话少说,直接上代码。
public static bool OpenBrowser(String url) { RegistryKey key = Registry.ClassesRoot.OpenSubKey(@"http\shell\open\command\"); String s = key.GetValue("").ToString(); String browserpath = null; if (s.StartsWith("\"")) { browserpath = s.Substring(1, s.IndexOf('\"', 1) - 1); } else { browserpath = s.Substring(0, s.IndexOf(" ")); } return System.Diagnostics.Process.Start(browserpath, url)!=null; }