admin管理员组

文章数量:1531282

WebBrowser中的浏览器版本和系统内核的浏览器有关。
需要使用特定浏览器有两种方法:
1.在网页中添加X-UA-Compatible标识
<META content="IE=9" http-equiv="X-UA-Compatible">设置为ie9模式
位置放置在head节点中的title节点后就行
需要注意的是:应该将浏览器加载js脚本,css脚本等工作放到设置该标识之后,应尽量使浏览器最早设置该标识,不然会出现无效的情况。 也就是在head节点前,减少其他浏览器的加载工作。

2.修改注册表(第一种方法,一般可以满足,尽量不要修改注册表)
32 bit:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION
Value Key: yourapplication.exe(应用程序文件)
64 bit:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION
Value Key: yourapplication.exe
以下是设置浏览器模式和文档模式,网页工程师应该理解。
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://wwwblogs/philzhou/archive/2012/12/02/2798204.html>

本文标签: 浏览器版本网页webbrowser