[英]how to open web browser control in IE 8
i am trying to use web browser control in my windows form application. 我试图在Windows窗体应用程序中使用Web浏览器控件。
By default the web browser renders in IE 7 mode.i need to run the application in at least IE 8 but not in compatibility mode, by default the web browser of .Net framework 4 opens in Compatibility mode. 默认情况下,Web浏览器以IE 7模式呈现。我需要至少在IE 8中运行应用程序,但不能以兼容模式运行,默认情况下, .Net Framework 4的Web浏览器以兼容模式打开。
After some search i found that i need to add a key in my regedit. 经过一番搜索,我发现我需要在regedit中添加一个密钥。 where i have to specify the application name and the required IE version.
我必须在其中指定应用程序名称和所需的IE版本。
I tried this but is not working 我尝试了这个但没有用
var IEVAlue = 8888; // for ie8
var targetApplication = System.Diagnostics.Process.GetCurrentProcess().ProcessName + ".exe";
var keyName = "FEATURE_BROWSER_EMULATION";
RegistryKey myKey = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl", RegistryKeyPermissionCheck.ReadWriteSubTree);
myKey.SetValue(keyName, IEVAlue, RegistryValueKind.DWord);
I don't know if you're chaning the key in HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER . 我不知道您是在HKEY_LOCAL_MACHINE还是HKEY_CURRENT_USER中更改密钥。 But it might be important to know if you're running 64-bit or 32 bit.
但是了解您运行的是64位还是32位可能很重要。
Under the software node in the registry, there's a node Wow6432 , and under that, you also have '\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl' . 在注册表中的软件节点下,有一个节点Wow6432 ,在该节点下,您还具有'\\ Microsoft \\ Internet Explorer \\ MAIN \\ FeatureControl' 。
Can you try changing the value in there and see if it's working? 您可以尝试更改其中的值,看看是否可行吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.