ASP函数判断访问是否来自搜索引擎
判断访问是否来自搜索引擎的函数,如果来源于几大主流搜索引擎的Spider的话可以判断,其他应该需要修改!
<%
'检查当前用户是否是蜘蛛人
Function check(user_agent)
allow_agent=split("Baiduspider,Scooter,ia_archiver,Googlebot,FAST-WebCrawler,MSNBOT,Slurp",",")
check_agent=false
For agenti=lbound(allow_agent) to ubound(allow_agent)
If instr(user_agent,allow_agent(agenti))>0 then
check_agent=true
exit for
end if
Next
check=check_agent
End function
user_agent=Request.ServerVariables("HTTP_USER_AGENT")
'check(user_agent)=true则判定访问为蜘蛛人
%>
注:本函数来源于网上,是否可用有待验证!
日期:2007-10-20 阅读统计:读取中.. 来自:网页教学网 作者:
最新评论 - 查看全部评论
- · 暂时没有评论!
发表评论
