ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

给WebBrowser控件指定IE的使用版本

2022-01-14 13:31:46  阅读:205  来源: 互联网

标签:控件 exe Explorer displayed WebBrowser dword IE


日期:2022年01月12日
作者:Commas
注释:最近遇到一个WIN7 32位用户,用脚本怎么指定IE版本,怎么不成功,手动修改注册表却成功了,琢磨了一下,发现问题了,所以就想着做一个比较全面的总结,一方面方便自己查阅,另一方面也希望可以帮助到需要帮助的小伙伴们,避免踩坑。若有纰漏,请各位小伙伴们指正;若有帮助,希望可以帮忙点个赞,谢谢 ^ _ ^


目录

文章目录


一、原理与IE参数浅谈

原理:若注册表有指定参数,则按照指定的IE版本运行,否则按照系统默认的IE版本运行;另外使用的电脑也一定要有安装指定的IE版本,才可以按照指定的IE版本运行;

WebBrowser控件指定IE版本有两种方法:
1、手工修改注册表信息;
2、双击运行脚本文件(reg文件);

DecHexDescription
110010x2EDFInternet Explorer 11.Webpages are displayed in IE11 Standards mode,regardless of the !DOCTYPE directive.
110000x2AF8Internet Explorer 11.Webpages containing standards-based !DOCTYPE directive are displayed in IE11 Standards mode.Default value for Internet Explorer 11.
100010x2711Internet Explorer 10.Webpages are displayed in IE10 Standards mode,regardless of the !DOCTYPE directive.
100000x2710Internet Explorer 10.Webpages containing standards-based !DOCTYPE directive are displayed in IE10 Standards mode.Default value for Internet Explorer 10.
99990x270FInternet Explorer 9.Webpages are displayed in IE9 Standards mode,regardless of the !DOCTYPE directive.
90000x2328Internet Explorer 9.Webpages containing standards-based !DOCTYPE directive are displayed in IE9 Standards mode.Default value for Internet Explorer 9.
88880x22B8Internet Explorer 8.Webpages are displayed in IE8 Standards mode,regardless of the !DOCTYPE directive.
80000x1F40Internet Explorer 8.Webpages containing standards-based !DOCTYPE directive are displayed in IE8 Standards mode.Default value for Internet Explorer 8.
70000x1B58Internet Explorer 7.Webpages containing standards-based !DOCTYPE directive are displayed in IE7 Standards mode.Default value for applications hosting the WebBrowser Control.

二、手工修改注册表信息

对于注册表的注册,得根据 xx位电脑系统 + xx位的应用程序 来选择路径进行注册,分两种情况,我将其称之为同位异位,分别如下所示:

  • 同位32位系统使用32位的应用程序64位系统使用64位的应用程序

在这里插入图片描述

HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)
    SOFTWARE
       Microsoft
          Internet Explorer
             Main
                FeatureControl
                   FEATURE_BROWSER_EMULATION
                      HelpPane.exe = (REG_DWORD) 00002710

其中HelpPane.exe是程序的名字,即嵌入了WebBrowser控件的可执行程序的名字,而数值00002710代表WebBrowser控件使用的IE的版本是IE10。

  • 异位64位系统使用32位的应用程序

在这里插入图片描述

HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)
    SOFTWARE
		WOW6432Node
	       Microsoft
    	      Internet Explorer
        	     Main
            	    FeatureControl
                	   FEATURE_BROWSER_EMULATION
                    	  AutoTax.exe = (REG_DWORD) 00002328

其中AutoTax.exe是程序的名字,即嵌入了WebBrowser控件的可执行程序的名字,而数值00002328代表WebBrowser控件使用的IE的版本是IE9。

三、双击运行脚本文件

AppName为嵌入了WebBrowser控件的可执行程序的名字,可以根据自己的应用程序名称,自行修改,以下为示例:

应用程序名称DWORD(32位)值(D)指定IE版本
AppName1dword:00002af8IE11
AppName2dword:00002710IE10
AppName3dword:00002328IE9
AppName4dword:00001F40IE8
AppName5dword:00001B58IE7
  • 同位32位系统使用32位的应用程序64位系统使用64位的应用程序
    以下代码的文件名称为test_same.reg,双击运行此文件即可注册;
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
"AppName1.exe"=dword:00002af8
"AppName2.exe"=dword:00002710
"AppName3.exe"=dword:00002328
"AppName4.exe"=dword:00001F40
"AppName5.exe"=dword:00001B58
  • 异位64位系统使用32位的应用程序
    以下代码的文件名称test_diff.reg,双击运行此文件即可注册;
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
"AppName1.exe"=dword:00002af8
"AppName2.exe"=dword:00002710
"AppName3.exe"=dword:00002328
"AppName4.exe"=dword:00001F40
"AppName5.exe"=dword:00001B58

参考文章:
1、《WebBrowser控件默认使用IE9,IE10的方法》
2、《Wow6432Node》
3、《后端 关于 WOW6432Node》


版权声明:本文为博主原创文章,如需转载,请给出:
原文链接:https://blog.csdn.net/qq_35844043/article/details/122429626

标签:控件,exe,Explorer,displayed,WebBrowser,dword,IE
来源: https://blog.csdn.net/qq_35844043/article/details/122429626

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有