网站制作学习网ASP→正文:asp判断浏览器
字体:

asp判断浏览器

ASP 2008/5/28 9:00:54  点击:不统计

关键词:asp判断浏览器,asp判断浏览器类型,asp判断浏览器函数,asp查看浏览器,asp查看浏览器类型

asp判断浏览器代码





Dim Agent,Browser,version,tmpstr

Agent=Request.ServerVariables("HTTP_USER_AGENT")

Agent=Split(Agent,";")

If InStr(Agent(1),"MSIE")>0 Then

Browser="MS Internet Explorer "

version=Trim(Left(Replace(Agent(1),"MSIE",""),6))

ElseIf InStr(Agent(4),"Netscape")>0 Then

Browser="Netscape "

tmpstr=Split(Agent(4),"/")

version=tmpstr(UBound(tmpstr))

ElseIf InStr(Agent(4),"rv:")>0 Then

Browser="Mozilla "

tmpstr=Split(Agent(4),":")

version=tmpstr(UBound(tmpstr))

If InStr(version,")") > 0 Then

tmpstr=Split(version,")")

version=tmpstr(0)

End If

End If

response.Write(""&Browser&" "&version&"")

·上一篇:asp探针 >>    ·下一篇:定义Sub调用失败 >>
推荐文章
最新文章