C#怎么使用默认浏览器打开网页

来源:互联网 发布:矢量地图数据下载 编辑:程序博客网 时间:2024/06/02 23:53

 

using Microsoft.Win32;

RegistryKey key = Registry.ClassesRoot.OpenSubKey(@"http\shell\open\command\");
string s = key.GetValue("").ToString();

s就是你的默认浏览器,不过后面带了参数,把它截去
System.Diagnostics.Process.Start(s.Substring(0, s.Length - 5), "
http://www.baidu.com");

原创粉丝点击