Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall
Often some local business-to-business or business-to-consumer websites are littered with lots of junk information, sharing my solutions:
Add the following code to your ASP page to test the effect:
<%
A collection of masked IP addresses (segments) with an asterisk of wildcard characters, usually stored in a configuration file.
Const Badipgroup = "192.168.1.*|202.68.*.*|*.12.55.34|185.*.96.24|127.*.0.1|192.168.0.1"
If Isforbidip (badipgroup) = True Then
Response.Write (GetIP & "IP address No Access")
Response.End ()
End If
' parameter vbadip: the IP segment to be screened, the IP address collection, the | symbol to separate multiple IP addresses (segments)
' returns bool:true User IP in the masked range, False vice versa
Function Isforbidip (VBADIP)
Dim counter, Arrippart, Arrbadip, Arrbadippart, I, J
Arrbadip = Split (Vbadip, "|")
Arrippart = Split (GetIP (), ".")
for i = 0 to UBound (ARRBADIP)
counter = 0
Arrbadippart = Split (Arrbadip (i), ".")
for j = 0 to UBound (arrippart)
If (Arrbadippart (j)) = "*" or CStr (Arrippart (j)) = CStr (Arrbadippart (j)) Then
counter = counter + 1
End If
Next
If counter = 4 Then
Isforbidip = True
Exit Function
End If
Next
Isforbidip = False
End Function
"Return the client IP address
Function GetIP ()
Dim IP
IP = Request.ServerVariables ("Http_x_forwarded_for")
If IP = "" Then IP = Request.ServerVariables ("REMOTE_ADDR")
GetIP = IP
End Function
%>
This restricts access to the IP segment of the site, and you can set it according to the region's IP segment.
I use this method to prevent foreign users from using rogue software malicious to my site to publish information!
The above content is transferred from (Yi Yuan Network) detailed source please refer to: http://www.05371.com/content/200891013820.html
Panorama survey of 100 internet CEOs in China http://www.admin5.com/article/20080921/105173.shtml