Set WebBrowser Core to IE 11 for Application
Posted xyphoenix
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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);//调试运行需要加上,否则不起作用
}
}
以上是关于Set WebBrowser Core to IE 11 for Application的主要内容,如果未能解决你的问题,请参考以下文章
C# winform webbrowser如何指定内核为IE11?