查看: 452|回复: 0

[文章教程] ASP获取侦测访问者系统的两个函数

[复制链接]
xuanxiao 发表于 2021-12-20 22:47:42 | 显示全部楼层 |阅读模式
  1. function OS_Type()
  2.     userAgent = LCase(Request.ServerVariables("HTTP_USER_AGENT"))
  3.     Dim mobile, c, rV
  4.     mobile = Split("windows|iphone|ipad|ipod|android|blackberry|mini|windowssce|palm", "|")
  5.     rV = "其他系统"
  6.     For c = 0 To UBound(mobile, 1)
  7.         If Instr(userAgent, mobile(c)) > 0 Then
  8.             rV = mobile(c)
  9.             Exit For
  10.         End If
  11.     Next
  12.        
  13.     OS_Type = rV
  14. End Function

  15. function Get_OS_Chinese(str)
  16.    select case str
  17.              case "windows"
  18.                          Get_OS_Chinese="Window"
  19.                          
  20.                          case "iphone"
  21.                          Get_OS_Chinese="苹果"
  22.                          
  23.                          case "android"
  24.                          Get_OS_Chinese="安卓"
  25.                          
  26.                          case "ipad"
  27.                          Get_OS_Chinese="苹果平板"
  28.                          
  29.                          case "blackberry"
  30.                          Get_OS_Chinese="黑莓"
  31.                          
  32.                          case "ipad"
  33.                          Get_OS_Chinese="苹果平板"                                                  
  34.                          
  35.                          case else
  36.                          Get_OS_Chinese="未知"                         
  37.    end select
  38.    

  39. End Function
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号