抱歉,给位,是自己疏忽了。
看到回复甚少,我只好细心摸索。毕竟那是MSDN里提到的办法,所以总感觉可能是自己操作除了问题。于是再次尝试通过修改注册表的方式来实现,竟然成功了!
说一下经过,方便同学们:为了减少潜在的问题,我恢复了系统(win7),IE初始版本为9,我先安装IE10,再安装IE11。安装过程很顺利。原先没这么做,总是提示安装IE11不成功。然后我改了注册表,不用重启,测试成功。
以下的博文给了我很大的启示:
WebBrowser控件默认使用IE9,IE10的方法
最近为了抓取淘宝的成交数据,用C#的WebBrowser控件开发了一个简单的程序. 发现WebBrowser控件默认使用的版本是IE7的兼容模式.而淘宝的宝贝详细页居然对IE7的支持不是很好. 成交记录无法显示,而我本机安装的是IE10,那么有没有办法使我的WebBrowser控件的使用的IE版本高点呢? 查找到了MSDN的一篇文章,上面有详细的说明,简单翻译如下:
1,打开注册表HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)
SOFTWARE
Microsoft
Internet Explorer
Main
FeatureControl
FEATURE_BROWSER_EMULATION
contoso.exe = (DWORD) 00000000
其中的"contoso.exe"为您的程序名字.即嵌入了WebBrowser控件的可执行程序的名字. 后面的数值"00000000"代表WebBrowser控件使用的IE的版本,值对应的IE版本如下图:
如果您使用的是64位的操作系统,而你的程序是32位的,那么你则要在以下注册表中更改该值.
HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)
SOFTWARE
Wow6432Node (楼主注:博主错写成了Wow6432Note)
Microsoft
Internet Explorer
Main
FeatureControl
FEATURE_BROWSER_EMULATION
contoso.exe = (DWORD) 00000000
360浏览器,傲游浏览器,淘宝浏览器等都可以用这种方式来操作.
注意: 我使用VS2010编译的时候,如果是Debug模式,那么我在注册表中更改的内容无效;如果使用了Release模式,则注册表的内容立即生效!
2017-07-19补充IE11的使用方法
11001 (0x2EDF) Internet Explorer 11. Webpages are displayed in IE11 Standards mode, regardless of the !DOCTYPE directive
(楼主注:经测试,DWORD键值以十进制输入时应该为11999,不知怎么这段来自Microsoft的提示却是11001,也正是这个原因,让我原先走了弯路,以为改注册表的方法无效)
11000 (0x2AF8) :Internet Explorer 11. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode
10000 (0x2710) :Internet Explorer 10. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode.
10001 (0x2AF7) :Internet Explorer 10. Webpages are displayed in IE10 Standards mode, regardless of the !DOCTYPE directive.
9999 (0x270F) :Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of the !DOCTYPE directive.
9000 (0x2328) :Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode.
8888 (0x22B8) :Webpages are displayed in IE8 Standards mode, regardless of the !DOCTYPE directive.
8000 (0x1F40) :Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode.
7000 (0x1B58) :Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode.
本文固定链接: http://extjs.org.cn/fatjames/archives/476 | 吴小强的博客