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&"")
%>
<%
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.net页面弄成伪静态页面
- ››Asp.net 中将汉字转换成拼音的方法
- ››ASP.NET及JS中的cookie基本用法
- ››浏览器Cookie:一半广告 一半隐私
- ››ASP.NET获取MS SQL Server安装实例
- ››判断Javascript 是否存在函数
- ››asp.net实现调用百度pai 在线翻译英文转中文
- ››ASP.NET页面选项进行提示判断
- ››Asp.net定时执行程序
- ››ASP.NET中利用DataList实现图片无缝滚动
- ››ASP.NET验证控件RequiredFieldValidator
- ››ASP.NET中使用System.Net.Mail发邮件
更多精彩
赞助商链接