指引网

当前位置: 主页 > 编程开发 > ASP >

asp 判断客户端操作系统

来源:网络 作者:佚名 点击: 时间:2017-08-23 21:47
[摘要] 指引教程为您提供asp 判断客户端操作系统等资源,欢迎您收藏本站,我们将为您提供最新的asp 判断客户端操作系统资源
<script>ec(2);</script>

 Function GetOs(content,systemOrBrowser)
  Dim temp
  temp = Split(content,";")
  Select Case systemOrBrowser
   Case 0
    If InStr(Content,"Windows NT 6.0") Then
     GetOs = "Windows Vista"
    ElseIf InStr(Content,"Windows NT 5.2") Then
     GetOs = "Windows 2003"
    ElseIf InStr(Content,"Windows NT 5.1") Then
     GetOs = "Windows XP"
    ElseIf InStr(Content,"Windows NT 5.0") Then
     GetOs = "Windows 2000"
    ElseIf InStr(Content,"Windows NT") Then
     GetOs = "Windows NT"
    ElseIf InStr(Content,"Windows 9") Then
     GetOs = "Windows 9x"
    ElseIf InStr(Content,"unix") Then
     GetOs = "Unix"
    ElseIf InStr(Content,"linux") Then
     GetOs = "Linux"
    ElseIf InStr(Content,"SunOS") Then
     GetOs = "SunOS"
    ElseIf InStr(Content,"BSD") Then
     GetOs = "BSD"
    ElseIf InStr(Content,"Mac") Then
     GetOs = "Mac"
    Else
     GetOs = "Other"
    End If
   Case 1
    If InStr(content,"Opera") Then
     GetOs = Replace(Left(content,InStr(content,"(") - 1),"/"," ")
    ElseIf InStr(content,"MSIE") > 0  Then
     GetOs = Trim(temp(1))
    Else
     GetOs = Replace(Right(temp(4),Len(temp(4)) - InstrRev(temp(4)," ")),"/"," ")
    End if
  End Select
 End Function

------分隔线----------------------------