Set WebBrowser Core to IE 11 for Application

【Set WebBrowser Core to IE 11 for Application】古之立大事者,不惟有超世之才,亦必有坚忍不拔之志。这篇文章主要讲述Set WebBrowser Core to IE 11 for Application相关的知识,希望能为你提供帮助。
private void setReg()
{
string myAppPath = System.IO.Path.GetFileName(System.Reflection.Assembly.GetExecutingAssembly().Location);
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWAREMicrosoftInternet ExplorerMAINFeatureControlFEATURE_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(@"SOFTWAREWow6432NodeMicrosoftInternet ExplorerMAINFeatureControlFEATURE_BROWSER_EMULATION", true);
if (key != null)
{
key.SetValue(myAppPath, ieVer, RegistryValueKind.DWord);
key.SetValue(myAppPath.Replace(".exe", ".vshost.exe"), ieVer, RegistryValueKind.DWord); //调试运行需要加上,否则不起作用
}
}

    推荐阅读