南昌网站建设,南昌网页设计品牌服务商 建站咨询电话:0791-3320008 13970006609
首页>>新闻中心>>行业动态

Date: 2009-05-12 00:00:00Written By

asp判断浏览器及版本号的代码

  • Tags: ASP , 积分 Counts:280 次

程序代码
<%
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&"")
%>
-

 


Copyright © 2009 All Rights Reserved Powered by 南昌互联网数据中心 本站关键字:南昌网站建设 南昌网站制作 南昌网页设计 南昌做网站
使用条款 - 法律声明 - 联系我们 - 站点地图 - 备案号 赣ICP备07500261号