IE7出来后检测浏览器 [英] Detecting the browser once IE7 comes out

查看:71
本文介绍了IE7出来后检测浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想确保一旦IE7

发布,我将进行浏览器检测。我当前的检测语句(使用VB.NET编写)是:

如果Me.Request.Browser.Browser.ToUpper()=" IE"然后

''用于Internet Explorer浏览器的代码

否则

''用于Internet Explorer以外的浏览器的代码

结束如果

我需要以什么方式修改它以使其适用于IE7?

谢谢。

-

Nathan Sokalski
nj ******** @ hotmail。 com
http://www.nathansokalski.com/

解决方案

Nathan Sokalski写道:


我想确保我在做IE7

发布后,浏览器检测将有效。我目前的检测声明(使用VB.NET编写)是:


如果Me.Request.Browser.Browser.ToUpper()=" IE"然后

''用于Internet Explorer浏览器的代码

否则

''用于Internet Explorer以外的浏览器的代码

结束如果


我需要以什么方式修改它以使其适用于IE7?

谢谢。

-

Nathan Sokalski
nj ******* *@hotmail.com
http://www.nathansokalski.com/



该测试版是免费提供的,可以帮助您发现其他区域

,您需要更新/修改您的IE7网站。微软还为网络开发人员提供了各种资源来为IE7做准备,我认为你可以在微软网站上找到这些资源。


Damien


" Nathan Sokalski" < nj ******** @ hotmail.comwrote in message

news:%2 **************** @ TK2MSFTNGP03.phx。 gbl ...


首先,请不要交叉发帖...


如果是Me.Request。 Browser.Browser.ToUpper()=" IE"然后

''用于Internet Explorer浏览器的代码

否则

''用于Internet Explorer以外的浏览器的代码

结束如果


我需要以什么方式修改它以使其适用于IE7?



对Request.Browser类的五秒钟检查会显示

所有其他属性......


我的IE7的Beta3副本(7.0.5450.4)将以下值(在

括号中)返回给Request.Browser对象:


..ActiveXControls(True)

..AOL(假)

..BackgroundSounds(True)

..Beta(False)

..浏览器(IE)

..CDF(假)

..ClVVersion(2.0.50727)

..Cookies(True)

..Crawler(False)

..EcmaScriptVersion(1.2)

..Frames(True)

..JavaApplets(真)

..JavaScript(真)

..MajorVersion(7)

..MinorVersion(0)

..MSDomVersion(7.0)

..平台(WinXP)

..Tables(True)

..Type(IE7)

..VBScript(True)

..版本(7.0)

.. W3CDomVersion(1.0)

..Win16(假)

..Win32(真)


我对.Beta属性感到有些疑惑,我原本期望

返回True而不是False ...


感谢您的样本。我认为它返回Beta = False的原因是

,因为它获取属性的位置,这是来自

Web.config文件的一部分,名为browserCaps,这是使用正则表达式(或者类似的东西)与User-Agent

字符串匹配,但我知道

不会单独发送所有属性。我个人认为,对于获得

Request.Browser对象,Microsoft应该执行以下操作之一:


1创建一个不同的类来访问他们创建的Web服务

确定属性值





2.定期更新Web.config

文件的< browserCaps部分(它们定期更新Windows,Office和其他一些
软件,为什么不这样呢?)


但是不要抱怨它,我现在很高兴,因为如果你的样本是

正确而且.Browser属性返回IE无论如何,我不需要对我的代码进行任何改变。谢谢。

-

Nathan Sokalski
nj * *******@hotmail.com
http:// www.nathansokalski.com/


" Mark Rae" < ma ** @ markNOSPAMrae.com写信息

新闻:uD ************** @ TK2MSFTNGP04.phx.gbl ...
< blockquote class =post_quotes>
" Nathan Sokalski" < nj ******** @ hotmail.comwrote in message

news:%2 **************** @ TK2MSFTNGP03.phx。 gbl ...


首先,请不要交叉发帖...


>如果我。 Request.Browser.Browser.ToUpper()=" IE"然后
''用于Internet Explorer浏览器的代码
否则
''用于Internet Explorer以外的浏览器的代码
结束如果

在什么我需要修改它以使其适用于IE7吗?



对Request.Browser类的五秒钟检查会显示

所有其他属性......


我的IE7的Beta3副本(7.0.5450.4)将以下值(在

括号中)返回给Request.Browser对象:


.ActiveXControls(True)

.AOL(假)

.BackgroundSounds(True)

.Beta(假)

。浏览器(IE)

.CDF(假)

.ClrVersion(2.0.50727)

.Cookies(True)

.Crawler(False)

.EcmaScriptVersion(1.2)

.Frames(True)

.JavaApplets(真的)

.JavaScript(真)

.MajorVersion(7)

.MinorVersion(0)

。 MSDomVersion(7.0)

。平台(WinXP)

。表(真)

.Type(IE7)

.VBScript(True)

。版本(7.0)

.W3CDomVersion(1.0)

.Win16(假)

.Win32(真)


我是对.Beta属性感到有些疑惑,我原本期望

返回True而不是False ......



I want to make sure I am doing a browser detection that will work once IE7
is released. My current detection statement (written using VB.NET) is:
If Me.Request.Browser.Browser.ToUpper() = "IE" Then
''Code to use for Internet Explorer browsers
Else
''Code to use for browsers other than Internet Explorer
End If
In what ways would I need to modify this to make it work for IE7 as well?
Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

解决方案

Nathan Sokalski wrote:

I want to make sure I am doing a browser detection that will work once IE7
is released. My current detection statement (written using VB.NET) is:
If Me.Request.Browser.Browser.ToUpper() = "IE" Then
''Code to use for Internet Explorer browsers
Else
''Code to use for browsers other than Internet Explorer
End If
In what ways would I need to modify this to make it work for IE7 as well?
Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

The Beta is freely available, and may help you discover other areas
where you need to update/amend your site for IE7. Microsoft have also
got various resources for web developers to prepare for IE7, which I
think you can find on the microsoft web site.

Damien


"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...

Firstly, please don''t cross-post...

If Me.Request.Browser.Browser.ToUpper() = "IE" Then
''Code to use for Internet Explorer browsers
Else
''Code to use for browsers other than Internet Explorer
End If
In what ways would I need to modify this to make it work for IE7 as well?

A five-second inspection of the Request.Browser class would have revealed
all its other properties...

My Beta3 copy of IE7 (7.0.5450.4) returns the following values (in
parentheses) to the Request.Browser object:

..ActiveXControls (True)
..AOL (False)
..BackgroundSounds (True)
..Beta (False)
..Browser (IE)
..CDF (False)
..ClrVersion (2.0.50727)
..Cookies (True)
..Crawler (False)
..EcmaScriptVersion (1.2)
..Frames (True)
..JavaApplets (True)
..JavaScript (True)
..MajorVersion (7)
..MinorVersion (0)
..MSDomVersion (7.0)
..Platform (WinXP)
..Tables (True)
..Type (IE7)
..VBScript (True)
..Version (7.0)
..W3CDomVersion (1.0)
..Win16 (False)
..Win32 (True)

I''m slightly puzzled about the .Beta property, which I would have expected
to return True instead of False...


Thank you for that sample. I think the reason for it returning Beta=False is
because of where it gets the properties, which is from a section of the
Web.config file called browserCaps which is matched against the User-Agent
string using regular expressions (or something like that, but I know it
doesn''t send all the properties individually). I personally think that
Microsoft should do one of the following as far as getting the
Request.Browser object:

1. Create a different class that accesses a web service that they create to
determine the property values

OR

2. Give periodic updates for the <browserCapssection of the Web.config
file (they give periodic updates for Windows, Office, and several other
pieces of software, why not for this?)

But rather than complain about it, I''m happy for now since if your sample is
correct and the .Browser property returns "IE" I don''t need to make any
changes to my code anyway. Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:uD**************@TK2MSFTNGP04.phx.gbl...

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...

Firstly, please don''t cross-post...

>If Me.Request.Browser.Browser.ToUpper() = "IE" Then
''Code to use for Internet Explorer browsers
Else
''Code to use for browsers other than Internet Explorer
End If
In what ways would I need to modify this to make it work for IE7 as well?


A five-second inspection of the Request.Browser class would have revealed
all its other properties...

My Beta3 copy of IE7 (7.0.5450.4) returns the following values (in
parentheses) to the Request.Browser object:

.ActiveXControls (True)
.AOL (False)
.BackgroundSounds (True)
.Beta (False)
.Browser (IE)
.CDF (False)
.ClrVersion (2.0.50727)
.Cookies (True)
.Crawler (False)
.EcmaScriptVersion (1.2)
.Frames (True)
.JavaApplets (True)
.JavaScript (True)
.MajorVersion (7)
.MinorVersion (0)
.MSDomVersion (7.0)
.Platform (WinXP)
.Tables (True)
.Type (IE7)
.VBScript (True)
.Version (7.0)
.W3CDomVersion (1.0)
.Win16 (False)
.Win32 (True)

I''m slightly puzzled about the .Beta property, which I would have expected
to return True instead of False...



这篇关于IE7出来后检测浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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