加入收藏 | 设为首页 | 会员中心 | 我要投稿 应用网_丽江站长网 (http://www.0888zz.com/)- 科技、建站、数据工具、云上网络、机器学习!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

ASP辨别搜索引擎蜘蛛的代码 谷歌 百度 雅虎 搜狐 MSN

发布时间:2022-01-09 10:36:11 所属栏目:Asp教程 来源:互联网
导读:ASP识别搜索引擎蜘蛛(谷歌、百度、雅虎、搜狐、MSN)代码如下: % 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
ASP识别搜索引擎蜘蛛(谷歌、百度、雅虎、搜狐、MSN)代码如下:
 
<%
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
%>
 

(编辑:应用网_丽江站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读