婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > asp 判斷是否為搜索引擎蜘蛛的代碼

asp 判斷是否為搜索引擎蜘蛛的代碼

熱門標簽:武穴地圖標注 濟源電銷外呼系統線路 梧州市地圖標注 創意電話機器人 石家莊慧營銷外呼系統 地圖標注陽江 世界地圖標注了哪些城市 java外呼系統是什么 外呼線路批發

復制代碼 代碼如下:

%
function GetBot()
'查詢蜘蛛
dim s_agent
GetBot=""
s_agent=Request.ServerVariables("HTTP_USER_AGENT") ‘關鍵判斷語句
if instr(1,s_agent,"googlebot",1) >0 then
GetBot="google"
end if
if instr(1,s_agent,"msnbot",1) >0 then
GetBot="MSN"
end if
if instr(1,s_agent,"slurp",1) >0 then
GetBot="Yahoo"
end if
if instr(1,s_agent,"baiduspider",1) >0 then
GetBot="baidu"
end if
if instr(1,s_agent,"sohu-search",1) >0 then
GetBot="Sohu"
end if
if instr(1,s_agent,"lycos",1) >0 then
GetBot="Lycos"
end if
if instr(1,s_agent,"robozilla",1) >0 then
GetBot="Robozilla"
end if
end function
if GetBot="baidu" then
'給百度定制的內容
elseif GetBot="google" then
'給google 定制的內容
end if
%>

下面是比較完整的代碼需要的朋友也可以參考下。里面還包括了一些客戶端信息。
復制代碼 代碼如下:

Class SystemInfo_Cls
Public Browser, version, platform, IsSearch, AlexaToolbar
Private Sub Class_Initialize()
Dim Agent, Tmpstr
IsSearch = False
If Not IsEmpty(Session("SystemInfo_Cls")) Then
Tmpstr = Split(Session("SystemInfo_Cls"), "|||")
Browser = Tmpstr(0)
version = Tmpstr(1)
platform = Tmpstr(2)
AlexaToolbar = Tmpstr(4)
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")
If InStr(Agent, "Alexa Toolbar") > 0 Then
AlexaToolbar = "YES"
Else
AlexaToolbar = "NO"
End If
If Left(Agent, 7) = "Mozilla" Then '有此標識為瀏覽器
Agent = Split(Agent, ";")
If InStr(Agent(1), "MSIE") > 0 Then
Browser = "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 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 IsSearch Then
Browser = ""
version = ""
Session("SystemInfo_Cls") = Browser "|||" version "|||" platform "|||1|||" AlexaToolbar
Else
Session("SystemInfo_Cls") = Browser "|||" version "|||" platform "|||0|||" AlexaToolbar
End If
End Sub
End Class

您可能感興趣的文章:
  • asp.net(c#)捕捉搜索引擎蜘蛛和機器人
  • php 判斷訪客是否為搜索引擎蜘蛛的函數代碼
  • PHP判斷搜索引擎蜘蛛并自動記憶到文件的代碼
  • PHP屏蔽蜘蛛訪問代碼及常用搜索引擎的HTTP_USER_AGENT
  • PHP記錄搜索引擎蜘蛛訪問網站足跡的方法
  • asp實現禁止搜索引擎蜘蛛訪問的代碼
  • php/asp/asp.net中判斷百度移動和PC蜘蛛的實現代碼
  • 根據user-agent判斷蜘蛛代碼黑帽跳轉代碼(js版與php版本)

標簽:揭陽 滁州 南寧 來賓 唐山 迪慶 甘南 淮北

巨人網絡通訊聲明:本文標題《asp 判斷是否為搜索引擎蜘蛛的代碼》,本文關鍵詞  asp,判斷,是否,為,搜索引擎,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《asp 判斷是否為搜索引擎蜘蛛的代碼》相關的同類信息!
  • 本頁收集關于asp 判斷是否為搜索引擎蜘蛛的代碼的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 大港区| 冕宁县| 手机| 崇阳县| 建宁县| 灵石县| 芒康县| 南川市| 泗洪县| 朝阳市| 阿克| 河北区| 方城县| 保德县| 改则县| 奉化市| 旬阳县| 集贤县| 永丰县| 长治市| 东宁县| 抚宁县| 光山县| 博兴县| 眉山市| 田林县| 勐海县| 凤山县| 噶尔县| 宝丰县| 板桥市| 华阴市| 成武县| 天祝| 铜山县| 花垣县| 江永县| 彰武县| 周口市| 丰都县| 章丘市|