【问题标题】:How to force a IE version in a Winform WebControl?如何在 Winform WebControl 中强制使用 IE 版本?
【发布时间】:2011-06-23 07:58:30
【问题描述】:

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

所以我添加了这个:

<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>

发现了这个:

original image

即使我在这台机器上安装了 Internet Explorer 8,webbrowser 控件仍会加载一个未安装的 IE (Internet Explorer 7) 版本。

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

【问题讨论】:

  • 看起来它以兼容模式加载给我。

标签: .net winforms .net-3.5 web-controls


【解决方案1】:

实际上可以强制控件使用特定版本的IE。看看这篇文章:Witch version of browser is used by the WebBrowser control?

【讨论】:

  • 很棒的收获......我希望不会因为许多公司使用它而发现代理问题。
【解决方案2】:

我认为这是不可能的。一种选择是将 WebKit 嵌入到您的应用程序中: http://sourceforge.net/projects/webkitdotnet/

这将使您的安装更大,但至少您将嵌入一个称职的浏览器。 :)

【讨论】:

  • 不错的链接 :) 会尝试一下
猜你喜欢
  • 2011-09-06
  • 1970-01-01
  • 1970-01-01
  • 2012-07-10
  • 1970-01-01
  • 2020-11-07
  • 2012-02-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多