码迷,mamicode.com
首页 > 移动开发 > 详细

Set WebBrowser Core to IE 11 for Application

时间:2020-01-30 14:18:33      阅读:85      评论:0      收藏:0      [点我收藏+]

标签:registry   Opens   ati   gas   intern   sub   exec   pen   运行   

private void setReg()
{
string myAppPath = System.IO.Path.GetFileName(System.Reflection.Assembly.GetExecutingAssembly().Location);
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION", true);
int ieVer = 11001;
if (key != null)
{
key.SetValue(myAppPath, ieVer, RegistryValueKind.DWord);
key.SetValue(myAppPath.Replace(".exe", ".vshost.exe"), ieVer, RegistryValueKind.DWord);//调试运行需要加上,否则不起作用
}

key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION", true);
if (key != null)
{
key.SetValue(myAppPath, ieVer, RegistryValueKind.DWord);
key.SetValue(myAppPath.Replace(".exe", ".vshost.exe"), ieVer, RegistryValueKind.DWord);//调试运行需要加上,否则不起作用
}
}

Set WebBrowser Core to IE 11 for Application

标签:registry   Opens   ati   gas   intern   sub   exec   pen   运行   

原文地址:https://www.cnblogs.com/xyphoenix/p/12242619.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!