用ASP实现识别搜索引擎蜘蛛的代码(GOOGLE,baidu,Yahoo,sohu,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
%>

网友评论
发表评论(最多1000字符)
昵称: 验证码:点击输入框获取验证码
Email:sell$china.com serve$wedonet.com Msn:wedonet$hotmail.com (请把$改成@发送)
QQ1:16216077 QQ2:37173120 QQ3:66066769 技术一线:022-26739208 销售二线:022-58697367 传真:022-58697367
Powered by www.wedonet.com. Style Name:Wedonet官网. Run Time: