网络编程
位置:首页>> 网络编程>> Asp编程>> 防止网站内容被人小偷和采集的ASP代码

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

  发布时间:2007-10-02 13:04:00 

标签:采集

防止一般的采集以及小偷读取,加在顶部。同理,可以改造成JS脚本。

下面的方法是通过选择同一IP的访问频率来达到防止采集的目的,就是可能也把搜索引擎拒绝了!


<%  
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  
%> 


0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com