ASP中怎样用Request.ServerVariables获取访客的系统版本和IE版本

来源:互联网 发布:暗黑3淘宝上的悬赏箱子 编辑:程序博客网 时间:2024/06/04 19:47
ASP中怎样用Request.ServerVariables获取访客的系统版本和IE版本
添加:烟鬼 点击:15 时间:06.05.01
   <%
    Function Browser(Info)
    Info=Request.ServerVariables("Http_User_Agent") '在这里初始化了Info,在实际应用中可以作为其他变量赋值
    If InStr(Info,"MSIE 6")>0 Then
    Browser="Internet Explorer 6.0"
    ElseIf InStr(Info,"MSIE 5.5")>0 Then
    Browser="Internet Explorer 5.5"
    ElseIf InStr(Info,"MSIE 5.0")>0 Then
    Browser="Internet Explorer 5.0"
    ElseIf InStr(Info,"MSIE 4")>0 Then
    Browser="Internet Explorer 4.0"
    Else
    Browser="未知的浏览器!"
    End if
    Response.Write "您的浏览器是:"&Browser&"<p>"
    End Function
   
    Function System(Info)
    Info=Request.ServerVariables("Http_User_Agent")
    If InStr(Info,"NT 5.1")>0 Then
    System="Windows XP"
    ElseIf InStr(Info,"NT 5.0")>0 Then
    System="Windows 2000"
    ElseIf InStr(Info,"NT 4")>0 Then
    System="Windows NT"
    ElseIf InStr(Info,"98")>0 Then
    System="Windows 98"
    ElseIf InStr(Info,"Me")>0 Then
    System="Windows Me"
    ElseIf InStr(Info,"95")>0 Then
    System="Windows 95"
    Else
    System="未知的操作系统!"
    End if
    Response.Write "您的操作系统是:"&System&"<p>"
    End Function
   
    Call Browser(Info)
    Call System(Info)
   
    %> 
原创粉丝点击