简体   繁体   English

如何在IE 8中打开Web浏览器控件

[英]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.

相关问题 ASP.net C#Web浏览器控件始终打开,即仅浏览器? - ASP.net C# web-browser Control always open ie browser only? 如何在Web浏览器(例如IE)中打开URL并传递凭据 - How can i open a url in web browser (such as IE) and pass credentials 网页浏览器控制默认IE版本 - Web browser control default IE version 从Web浏览器控件打开证书信息 - Open Certificate Information from Web Browser Control 如何通过Web浏览器控件在新的浏览器选项卡中打开url(显示具有链接的PDF)C# - How to open url in new browser tab from Web browser control (displaying PDF having a link) c# 如何在浏览器中使用Web浏览器控件? - How to use web browser control in the browser? C# Web 浏览器控制 - 让它像 IE 一样 - C# Web Browser Control - Make it Just Like IE Web浏览器控件中的拼写检查在IE11仿真下不起作用 - Spellcheck in web browser control not working under IE11 emulation IE 8在Windows 7 64位Web浏览器控件中出现“ Stackoverflow错误” - 'Stackoverflow error' in Windows 7 64 bit web browser control with IE 8 我如何在不打开图像ui的情况下在c#中的Web浏览器控件中插入图像? - how i can insert an image in web browser control in c# with out open image ui?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM