如何在Winform WebControl中强制IE版本? [英] How to force a IE version in a Winform WebControl?

查看:84
本文介绍了如何在Winform WebControl中强制IE版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在一个网页设计中找出问题所在,并记得使用一个简单的javascript来获取浏览器版本,因为我有两种完全不同的行为

I was trying to find out the problem in one web design I had and remembered to use a simple javascript to get the browser version as I had completly 2 different behaviors

所以我添加了这个:

<div id="example"></div>

<script type="text/javascript">

txt = "<p>Browser CodeName: " + navigator.appCodeName + "</p>";
txt+= "<p>Browser Name: " + navigator.appName + "</p>";
txt+= "<p>Browser Version: " + navigator.appVersion + "</p>";
txt+= "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";
txt+= "<p>Platform: " + navigator.platform + "</p>";
txt+= "<p>User-agent header: " + navigator.userAgent + "</p>";

document.getElementById("example").innerHTML=txt;

</script>

并发现以下内容:

< img src = https://i.stack.imgur.com/Cijur.png alt =在此处输入图片描述>

原始图片

即使我有在此计算机上安装了Internet Explorer 8 后,webbrowser控件会加载未安装的IE(Internet Explorer 7)版本。

even though I have Internet Explorer 8 installed on this machine, the webbrowser control loads a version of IE (Internet Explorer 7) that is not the one installed.


如何强制使用正确的版本?


推荐答案

实际上,可以强制控件使用特定版本的IE。看看这篇文章: WebBrowser控件使用浏览器的巫婆版本吗?

Actually it is possible to force the control to use particular version of IE. Have a look at this article: Witch version of browser is used by the WebBrowser control?

这篇关于如何在Winform WebControl中强制IE版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆