您的位置:首页 > 其它

webbrowser控件默认IE版本修改

2014-11-14 13:46 288 查看
       private void IeRegidet()
        {
            string value32 = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION", true).GetValue("(32)YdCallCenter.exe", "null", Microsoft.Win32.RegistryValueOptions.None).ToString();
            string value64 = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION", true).GetValue("(32)YdCallCenter.exe", "null", Microsoft.Win32.RegistryValueOptions.None).ToString();
            log.WriteLog("frmLogin", "IeRegidet", "value32" + value32 + "value64" + value64);
            if (!value32.Equals("8888") || !value64.Equals("8888"))
            {
                RegistryKey key32 = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION");
                key32.SetValue("(32)YdCallCenter.exe", 8888, Microsoft.Win32.RegistryValueKind.DWord);
                key32.Close();
                RegistryKey key64 = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION");
                key64.SetValue("(32)YdCallCenter.exe", 8888, Microsoft.Win32.RegistryValueKind.DWord);
                key64.Close();
                log.WriteLog("frmLogin", "IeRegidet", "DONE");
            }  
        } 

修改注册表,因为32位系统和64位系统所需要改的位置不同,所以一起改了!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: