WebBrowser中的浏览器版本和系统内核的浏览器有关。admin管理员组文章数量:1531282
需要使用特定浏览器有两种方法:
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_EMULATION64 bit:
Value Key: yourapplication.exe(应用程序文件)
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION9999 (0x270F)
Value Key: yourapplication.exe
以下是设置浏览器模式和文档模式,网页工程师应该理解。
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
版权声明:本文标题:解决WebBrowser浏览器版本导致网页显示变形的问题 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1726371377a1067661.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论