ASP Anti-acquisition code

Source: Internet
Author: User

Collection is now the webmaster commonly used rapid construction of the station, we can use a professional acquisition software to achieve rapid collection, this site can be quickly built, but for the owner to be picked this is a pain ah, because the bandwidth problem will make the site can not be normal access OH. Let's look at an ASP method to prevent the collection.

<%
Dim Appealnum,appealcount
appealnum=10 ' request limit 10 times in the same IP60 seconds
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 "Crawl very tired, rest for a while!" "
Response.End
End If
%>
Above the wisdom of the collection of the ASP Cookes to realize the number of visits to the site, here is a bug is if a network of pessimism is not visited many times, there is a google,baidu may also appear problems, this to pay attention to the SEO station is a serious blow oh,

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.