zoukankan      html  css  js  c++  java
  • asp vbscript 检测客户端浏览器和操作系统(也可以易于升级到ASP.NET)

    dim Info,SystemName,BrowserName,ipdress
     Info=Request.ServerVariables("Http_User_Agent")
    
    '涂聚文 2009/09/30 缔友计算机信息技术有限公司 捷为工作室 =其次:用Request.ServerVariables("Http_User_Agent")=
    'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 598; .NET CLR 2.0.50727; CIBA; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; InfoPath.2)
    'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.13) Gecko/2009080717 Firefox/3.0.13
     'Opera/9.80 (Windows NT 5.1; U; zh-cn) Presto/2.2.15 Version/10.01
     'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 QQDownload/1.7
    'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 QQDownload/1.7
    'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.27 Safari/532.0
    'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9.1
    'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080219 Firefox/2.0.0.12 Navigator/9.0.0.6
    Function Browser(Info)
    Info=Request.ServerVariables("Http_User_Agent") '在这里初始化了Info,在实际应用中可以作为其他变量赋值
    'Response.Write Info & "<p>"
    If InStr(Info,"MSIE 9")>0 Then
    Browser="Internet Explorer 9"
    If InStr(Info,"MSIE 8")>0 Then
    Browser="Internet Explorer 8"
    ElseIf InStr(Info,"MSIE 7")>0 Then
    Browser="Internet Explorer 7"
    ElseIf InStr(Info,"MSIE 6")>0 Then
    Browser="Internet Explorer 6"
    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"
    ElseIf InStr(Info,"Opera")>0 Then
    Browser="Opera"
    ElseIf InStr(Info,"Firefox")>0 and InStr(Info,"Chrome/3")=0 and InStr(Info,"Safari/5")=0 and InStr(Info,"Navigator")=0 Then
    Browser="Firefox"
    ElseIf InStr(Info,"Chrome")>0 and InStr(Info,"Safari")>0 Then
    Browser="Chrome"
    ElseIf InStr(Info,"Safari")>0 Then
    Browser="Safari"
    'Navigator
    ElseIf InStr(Info,"Navigator")>0 and InStr(Info,"Firefox")>0 Then
    Browser="Navigator"
    Else
    Browser="未知的浏览器"
    End if
    'Response.Write "'涂聚文 2009/09/30 缔友计算机信息技术有限公司 捷为工作室您的浏览器是:"&Browser&"<p>"
    BrowserName=Browser
    End Function
    
    Function System(Info)
    Info=Request.ServerVariables("Http_User_Agent")
    If InStr(Info,"Windows NT 6.1")>0 Then
    System="Windows7/2008R2"
    ElseIf InStr(Info,"Windows NT 6.0")>0 Then
    System="Vista/2008"
    ElseIf InStr(Info,"Windows NT 5.2")>0 Then
    System="Windows 2003"
    ElseIf InStr(Info,"Windows NT 5.1")>0 Then
    System="Windows XP"
    ElseIf InStr(Info,"Windows NT 5.0")>0 Then
    System="Windows 2000"
    ElseIf InStr(Info,"Windows 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"
    ElseIf InStr(Info,"Mac")>0 Then
    System="Mac"
    ElseIf InStr(Info,"Unix")>0 Then
    System="Unix"
    ElseIf InStr(Info,"Linux")>0 Then
    System="Linux"
    ElseIf InStr(Info,"SunOS")>0 Then
    System="SunOS"
    Else
    System="未知的操作系统"
    End if
    'Response.Write "您的操作系统是:"&System&"<p>"
     SystemName=System
    End Function
    
    BrowserName= Browser(Info)
    SystemName= System(Info)
    ipdress=Request.ServerVariables("REMOTE_ADDR")
    
    哲学管理(学)人生, 文学艺术生活, 自动(计算机学)物理(学)工作, 生物(学)化学逆境, 历史(学)测绘(学)时间, 经济(学)数学金钱(理财), 心理(学)医学情绪, 诗词美容情感, 美学建筑(学)家园, 解构建构(分析)整合学习, 智商情商(IQ、EQ)运筹(学)成功.---Geovin Du(涂聚文)
  • 相关阅读:
    Serialization and deserialization are bottlenecks in parallel and distributed computing, especially in machine learning applications with large objects and large quantities of data.
    Introduction to the Standard Directory Layout
    import 原理 及 导入 自定义、第三方 包
    403 'Forbidden'
    https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
    These interactions can be expressed as complicated, large scale graphs. Mining data requires a distributed data processing engine
    mysqldump --flush-logs
    mysql dump 参数
    mysql dump 参数
    如果是在有master上开启了该参数,记得在slave端也要开启这个参数(salve需要stop后再重新start),否则在master上创建函数会导致replaction中断。
  • 原文地址:https://www.cnblogs.com/geovindu/p/2320272.html
Copyright © 2011-2022 走看看