日期:2014-05-17  浏览次数:21120 次

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
这个位置的更准确些