一个勾引蜘蛛ASP的代码
<%
'=============================
' 抓取蜘蛛爬行
'=============================
'立即超时,防止漏统计
Response.Expires = 0
'获取蜘蛛类型
Bot="no"
luzj_botinfo=Request.ServerVariables("HTTP_USER_AGENT")
luzj_botinfo=lcase(luzj_botinfo)
if instr(luzj_botinfo,"bot") then Bot="其它蜘蛛"
if instr(luzj_botinfo,"google") then Bot="Google蜘蛛"
if instr(luzj_botinfo,"yahoo") then Bot="yahoo蜘蛛"
if instr(luzj_botinfo,"baidu") then Bot="百度蜘蛛"
if instr(luzj_botinfo,"msnbot") then Bot="微软蜘蛛"
if instr(luzj_botinfo,"iask") then Bot="新浪iask"
if instr(luzj_botinfo,"sogou") then Bot="搜狗蜘蛛"
if instr(luzj_botinfo,"yodao") then Bot="有道蜘蛛"
if instr(luzj_botinfo,"soso") then Bot="搜搜蜘蛛"
'是蜘蛛才执行下面代码,记录详细信息
if Bot<>"no" then
dim udb
udb="botluzj.mdb"
Set Conn = Server.CreateObject("ADODB.Connection")
myconn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&udb&"")
Conn.Open myconn
Set rs = Server.CreateObject("ADODB.Recordset")
response.write "ok"
'获取被访问页面
requeststring=Request.ServerVariables("QUERY_STRING")
wenchar=""
if requeststring <>"" then wenchar="?"
viewpage="
http://"&Request.ServerVariables("HTTP_HOST")&Request.ServerVariables("URL")&wenchar&requeststring
'获取IP地址
viewip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If viewip="" Then viewip = Request.ServerVariables("REMOTE_ADDR")
thetime=Now
rs.Open "bot",Conn,adOpenDynamic,3
rs.AddNew
rs("ip")=viewip
rs("time")=thetime
rs("page")=viewpage
rs("bot")=Bot
rs("botinfo")=luzj_botinfo
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%>
[ 本帖最后由 黑白之恋 于 2008-6-12 16:15 编辑 ]