打印

[ASP在线教程] 防止网站内容被人小偷和采集的asp代码

防止网站内容被人小偷和采集的asp代码

防止一般的采集以及小偷读取,加在顶部。同理,可以改造成js脚本。
以下是引用片段:
  <%  
dim appealnum,appealcount  
appealnum=10 '同一ip60秒内请求限制10次  
appealcount=request.cookies("appealcount")  
if appealcount="" then  
response.cookies("appealcount")=1  
appealcount=1  
response.cookies("appealcount").expires=dateadd("s",60,now())  
else  
response.cookies("appealcount")=appealcount+1  
response.cookies("appealcount").expires=dateadd("s",60,now())  

end if  
if int(appealcount)>int(appealnum) then  
response.write "抓取很累,歇一会儿吧!"  
response.end  
end if  
%>  

  



TOP

返回顶部
AYBlue

Processed in 0.065709 second(s), 7 queries.

当前时区 GMT+8, 现在时间是 2009-1-8 14:42 京ICP备06054220号

清除 Cookies - 联系我们 - 163K.com - Archiver - WAP