分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 技术分享

WebBrowser控件默认使用IE9,IE10的方法

发布时间:2023-09-06 01:13责任编辑:白小东关键词:Web
最近为了抓取淘宝的成交数据,用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        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
  • 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.
Loading...

来源: http://extjs.org.cn/fatjames/archives/476


null


WebBrowser控件默认使用IE9,IE10的方法

原文地址:http://www.cnblogs.com/liyanwei/p/7591878.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved