开发学院WEB开发ASP asp判断浏览器及版本号 阅读

asp判断浏览器及版本号

 2009-05-07 10:39:45 来源:WEB开发网   
核心提示:程序代码<%Dim Agent,Browser,version,tmpstrAgent=Request.ServerVariables("HTTP_USER_AGENT")Agent=Split(Agent,";")If InStr(Agent(1),"MSIE&
程序代码
<%
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&"")
%>

Tags:asp 判断 浏览器

编辑录入:爽爽 [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接