萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> asp編程 >> ASP防止網站內容被采集代碼

ASP防止網站內容被采集代碼

 <% 

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

copyright © 萬盛學電腦網 all rights reserved