报告由WebBrowser控件UserAgent的什么? [英] What UserAgent is reported by the WebBrowser control?

查看:136
本文介绍了报告由WebBrowser控件UserAgent的什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道浏览器类型的VB.NET内容时,访问的网页。比如在我的网站就说明一切访问我的网站在不同的浏览器下休息。

Just wondering what browser type the VB.NET reads as when it visits a webpage. For instance on my website it shows a break down of all the different browsers that accessed my site.

推荐答案

您不会对您的问题提供多少上下文,但我认为你在谈论的用户代理字符串,当你使用<$c$c>WebBrowser控制内置在.NET框架。

You don't provide much context to your question, but I assume that you're talking about the User Agent string that's sent when you use the WebBrowser control built into the .NET Framework.

由于该控件只使用Internet Explorer来渲染页面,你会看到一个用户代理字符串非常相似,你会发现,如果你访问使用IE浏览器在同一台计算机上的页面。 IE的字符串一般报告本身作为的Mozilla / 4.0兼容,也给MSIE的具体版本,并列出了Windows的最新版本。

Because that control just uses Internet Explorer to render the page, you'll see a User Agent string very similar to what you'd find if you visited the page using IE on the same computer. The IE string generically reports itself as Mozilla/4.0 compatible, but also gives the specific version of MSIE and lists the current version of Windows.

例如,在64位版本的Windows Server 2008 R2的4.0版本的.NET Framework上运行,我确定我每次上网从 web浏览器控制:

For example, running under the 64-bit version of Windows Server 2008 R2 with version 4.0 of the .NET Framework, I'm identified as follows whenever I surf to pages from the WebBrowser control:

的Mozilla / 4.0(兼容; MSIE 7.0; Windows NT的6.1)

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1)

相比之下,IE浏览器在机器上显示相同的这是用户代理字符串:

By contrast, Internet Explorer on the same machine displays this as the User Agent string:

的Mozilla / 4.0(兼容; MSIE 8.0; Windows NT的6.1)

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)

唯一的区别是,.NET web浏览器控制报告本身作为Internet Explorer版本7.0( MSIE 7.0 ) ,而不是8.0版本已安装在机器上。这是因为控制使用IE 7的渲染引擎,而不是一个在IE 8中,出于兼容性考虑。如果你愿意,你可以改变这种通过编辑注册表值。

The only difference being that the .NET WebBrowser control reports itself as Internet Explorer version 7.0 (MSIE 7.0), instead of version 8.0 that is installed on the machine. This is because the control uses the IE 7 rendering engine, rather than the one in IE 8, for compatibility reasons. If you want, you can change this by editing a registry value.

要运行 web浏览器在IE8标准模式控制,使用下面的新值到注册表:

To run a WebBrowser control in IE8 Standards Mode, use the following new value into the registry:

[(HKEY_CURRENT_USER或HKEY_LOCAL_MACHINE)\软件\微软\的Internet Explorer \ MAIN \ FeatureControl \ FEATURE_BROWSER_EMULATION]   MyApplication.exe= DWORD 8000(十六进制:0x1F40)

[(HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE)\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION] "MyApplication.exe" = dword 8000 (Hex: 0x1F40)

要在IE7标准模式下运行,使用下面的注册表值:

To run in IE7 Standards Mode, use the following registry value:

[(HKEY_CURRENT_USER或HKEY_LOCAL_MACHINE)\软件\微软\的Internet Explorer \ MAIN \ FeatureControl \ FEATURE_BROWSER_EMULATION]   MyApplication.exe= DWORD 7000(十六进制:0x1B58)

[(HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE)\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION] "MyApplication.exe" = dword 7000 (Hex: 0x1B58)

这篇关于报告由WebBrowser控件UserAgent的什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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