C#.NET中WebBrowser控件修改默认IE内核的方法

2016/6/1 21:27:31 人评论 次浏览 分类:.NET


WebBrowser控件默认使用的IE(只能是IE,Google的chrome和Firefox都不行)的内核基本是比较低的版本,所以到导致WebBrowser无法载入主流的网页。根据下面的操作就可以实现修改默认IE内核。


1.确定运行程序的Window的属于32bit还是64bit的。注册表设置的位置不同。
32bit:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"Spider.exe"=dword:0000270f
"Spidesssr.vshost.exe"=dword:0000270f

64bit:
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"Spider.exe"=dword:0000270f
"Spider.vshost.exe"=dword:0000270f

以上的可以保存到文本文件修改后缀为“.reg”直接运行即可,或者可以根据上面的路径展开到FEATURE_BROWSER_EMULATION,添加对应的值。




2.在VS调试的时候,要注意添加“.vshost.exe”对应的值,否则进行调试,只能在bin或者obj的release和debug中打开才行。
在设置WebBrowser控件修改默认内核时可以加载这个地址 http://ie.icoa.cn/,查看浏览器WebBrowser控件的默认内核。



3.关于注册表项的各可能取值描述
    - 
7000 (0x1B58)
Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode.Default value for applications hosting the WebBrowser Control.
包含标准!DOCTYPE指令的页面将会以IE7兼容模式打开。WebBrowser控件的默认值。
    - 
8000 (0x1F40)
Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode. Default value for Internet Explorer 8
Important  In Internet Explorer 10, Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode.
包含标准!DOCTYPE指令的页面将会以IE8兼容模式打开,IE8浏览器的默认值。对于IE10来说,包含标准!DOCTYPE指令的页面会以IE10兼容模式打开。
    - 
8888 (0x22B8)
Webpages are displayed in IE8 Standards mode, regardless of the declared !DOCTYPE directive. Failing to declare a !DOCTYPE directive causes the page to load in Quirks.
无论是否声明!DOCTYPE指令,页面以IE8兼容模式打开。对于未正确声明!DOCTYPE指令的页面,将会以怪异模式(quirks mode)加载。
    - 
9000 (0x2328)
Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode. Default value for Internet Explorer 9.
Important  In Internet Explorer 10, Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode.
IE9,包含标准!DOCTYPE指令的页面将会以IE9兼容模式打开,IE9浏览器的默认值。对于IE10来说,包含标准!DOCTYPE指令的页面会以IE10兼容模式打开。
    - 
9999 (0x270F)
Windows Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of the declared !DOCTYPE directive. Failing to declare a !DOCTYPE directive causes the page to load in Quirks.
IE9,无论是否声明!DOCTYPE指令,页面以IE9兼容模式打开。对于未正确声明!DOCTYPE指令的页面,将会以怪异模式(quirks mode)加载。
    - 
10000 (0x02710)
Internet Explorer 10. Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode. Default value for Internet Explorer 10.
IE10,包含标准!DOCTYPE指令的页面将会以IE10兼容模式打开,IE10浏览器的默认值。
    - 
10001 (0x2711)
Internet Explorer 10. Webpages are displayed in IE10 Standards mode, regardless of the !DOCTYPE directive. 
IE10,无论是否声明!DOCTYPE指令,页面以IE10兼容模式打开。
    - 
11001 (0x2AF9)
IE11. Webpages containing standards-based !DOCTYPE directives are displayed in IE11 edge mode. Default value for IE11.
IE11,包含标准!DOCTYPE指令的页面将会以IE11兼容模式打开,IE11浏览器的默认值。
    - 
11000 (0x2AF8)
Internet Explorer 11. Webpages are displayed in IE11 edge mode, regardless of the declared !DOCTYPE directive. Failing to declare a !DOCTYPE directive causes the page to load in Quirks.
IE11,无论是否声明!DOCTYPE指令,页面将会以IE11的edge模式打开。对于未正确声明!DOCTYPE指令的页面,将会以怪异模式(quirks mode)加载。

相关资讯

  • Windows环境下ASP.NET Core项目站点自启动运行

    ASP.NET Core可以通过 IIS站点发布 ,也可以通过自运行启动站点。也就只要安装了dotnet (.net core SDK )就可以自启动网站,不需要依赖IIS。

    2018/11/11 18:00:56
  • VS2017环境与.NET Core SDK下载安装

    都2018年了,如果是VS2015的,还是直接升级到VS2017吧。首先先安装.NET Core SDK,,然后再安装 VS2017。

    2018/7/10 22:57:35
  • VS2015中的.NET Core SDK下载与安装搭建Asp.net core开发环境

    VS2015时没有自带ASP.NET Core(VS2017是自带Core的,只要在安装的时候选择安装core跨平台即可),如果要使用.NET Core的开发环境就需要单独安装.NET Core SDK。下面我们介绍是在VS2015的环境下安装.NET Core SDK的步骤。

    2018/7/10 21:36:05
  • 【window服务系列】C#.Net的window服务的调试

    window service 创建成功之后就可以进行调试了。1.安装并运行服务这里不详细说。可以用installutil.exe或者 netstart。运行之后,服务程序的就是运行在进程中。2.附加到进程。这里不能直接运行启动调试(F5)。选择对应的服务程序进行附加。3.添加调试代码。因为我们要启动了服…

    2017/6/15 20:08:59

共有访客发表了评论 网友评论

验证码: 看不清楚?