|
发表于 2006-10-31 00:16:32
|
显示全部楼层
") Browser = Tmpstr(0) Version = Tmpstr(1) platform = Tmpstr(2) If Tmpstr(3) = "1" Then IsSearch = True End If Exit Sub End If Browser = "unknown" Version = "unknown" platform = "unknown" Agent = Request.ServerVariables("HTTP_USER_AGENT") 'Agent="Opera/7.23 (X11; Linux i686; U) [en]" If Left(Agent, 7) = "Mozilla" Then '有此标识为浏览器 Agent = Split(Agent, ";") If InStr(Agent(1), "MSIE") > 0 Then Browser = "Microsoft 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 If InStr(Agent(2), "NT 5.2") > 0 Then platform = "Windows Server 2003" ElseIf InStr(Agent(2), "Windows CE") > 0 Then platform = "Windows CE" ElseIf InStr(Agent(2), "NT 5.1") > 0 Then platform = "Windows XP" ElseIf InStr(Agent(2), "NT 4.0") > 0 Then platform = "Windows NT" ElseIf InStr(Agent(2), "NT 5.0") > 0 Then platform = "Windows 2000" ElseIf InStr(Agent(2), "NT") > 0 Then platform = "Windows NT" ElseIf InStr(Agent(2), "9x") > 0 Then platform = "Windows ME" ElseIf InStr(Agent(2), "98") > 0 Then platform = "Windows 98" ElseIf InStr(Agent(2), "95") > 0 Then platform = "Windows 95" ElseIf InStr(Agent(2), "Win32") > 0 Then platform = "Win32" ElseIf InStr(Agent(2), "Linux") > 0 Then platform = "Linux" ElseIf InStr(Agent(2), "SunOS") > 0 Then platform = "SunOS" ElseIf InStr(Agent(2), "Mac") > 0 Then platform = "Mac" ElseIf UBound(Agent) > 2 Then If InStr(Agent(3), "NT 5.1") > 0 Then platform = "Windows XP" End If If InStr(Agent(3), "Linux") > 0 Then platform = "Linux" End If End If If InStr(Agent(2), "Windows") > 0 And platform = "unknown" Then platform = "Windows" End If ElseIf Left(Agent, 5) = "Opera" Then '有此标识为浏览器 Agent = Split(Agent, "/") Browser = "Mozilla " Tmpstr = Split(Agent(1), " ") Version = Tmpstr(0) If InStr(Agent(1), "NT 5.2") > 0 Then platform = "Windows 2003" ElseIf InStr(Agent(1), "Windows CE") > 0 Then platform = "Windows CE" ElseIf InStr(Agent(1), "NT 5.1") > 0 Then platform = "Windows XP" ElseIf InStr(Agent(1), "NT 4.0") > 0 Then platform = "Windows NT" ElseIf InStr(Agent(1), "NT 5.0") > 0 Then platform = "Windows 2000" ElseIf InStr(Agent(1), "NT") > 0 Then platform = "Windows NT" ElseIf InStr(Agent(1), "9x") > 0 Then platform = "Windows ME" ElseIf InStr(Agent(1), "98") > 0 Then
platform = "Windows 98" ElseIf InStr(Agent(1), "95") > 0 Then platform = "Windows 95" ElseIf InStr(Agent(1), "Win32") > 0 Then platform = "Win32" ElseIf InStr(Agent(1), "Linux") > 0 Then platform = "Linux" ElseIf InStr(Agent(1), "SunOS") > 0 Then platform = "SunOS" ElseIf InStr(Agent(1), "Mac") > 0 Then platform = "Mac" ElseIf UBound(Agent) > 2 Then If InStr(Agent(3), "NT 5.1") > 0 Then platform = "Windows XP" End If If InStr(Agent(3), "Linux") > 0 Then platform = "Linux" End If End If Else '识别搜索引擎 Dim botlist, i botlist = "Google,Isaac,Webdup,SurveyBot,Baiduspider,ia_archiver,P.Arthur,FAST-WebCrawler,Java,Microsoft-ATL-Native,TurnitinBot,WebGather,Sleipnir" botlist = Split(botlist, ",") For i = 0 To UBound(botlist) If InStr(Agent, botlist(i)) > 0 Then platform = botlist(i) & "搜索器" IsSearch = True Exit For End If Next End If If Version <> "unknown" Then Dim Tmpstr1 Tmpstr1 = Trim(Replace(Version, ".", "")) If Not IsNumeric(Tmpstr1) Then Version = "unknown" End If End If If IsSearch Then Browser = "" Version = "" Session("Cls_Browser") = Browser & " |
|