ASP实现防止网站被采集代码
(编辑:jimmy 日期: 2024/11/9 浏览:3 次 )
复制代码 代码如下:
<%
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
%>
<%
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
%>
下一篇:ASP向Excel导数据(图片)终结版 ASP操作Excel