首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C#怎么判断当前默认浏览器是否为IE

2013-03-27 
C#如何判断当前默认浏览器是否为IE?RT,RegistryKey key Registry.ClassesRoot.OpenSubKey(@http\shell\

C#如何判断当前默认浏览器是否为IE?
RT,

RegistryKey key = Registry.ClassesRoot.OpenSubKey(@"http\shell\open\command");
            string s = key.GetValue("").ToString();
            string str = s.Substring(s.IndexOf(":") - 1, s.IndexOf(".exe") + ".exe".Length - s.IndexOf(":") + 1);
            System.Diagnostics.Process.Start(str, "www.hao123.com");
如此方式是调用IE以外的默认浏览器打开好123,但是如果IE是默认浏览器的话str里面的那个值仍然是上个非IE默认浏览器的地址。所以我想问如何才能判断默认浏览器是否为IE呢? c# ie 浏览器
[解决办法]
HKEY_CLASSES_ROOT\http\shell\open\command 
不够准确
            HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice
这个位置的更准确些  

热点排行