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