这个呢?自己下载到,然后改的,好像还是不能 block 到,我自己的 IP 还是可以进入。
<%
Dim shortIP, mySplit, LongIP
shortIP = Request.ServerVariables("REMOTE_HOST")
mySplit = Split(shortIP, ".")
LongIP = (mySplit(0)*(256*256*256)) + (mySplit(1)*(256*256)) + (mySplit(2)*256) + (mySplit(3))
'Create Array
Dim myArray(132,2)
Randomize
'Array Definition is (Country Name ,Begin Range, End Range)
myArray(0,0) = "MALAYSIA"
myArray(0,1) = "1023803392"
myArray(0,2) = "1023852543"
myArray(1,0) = "MALAYSIA"
myArray(1,1) = "2428960768"
myArray(1,2) = "2429026303"
myArray(2,0) = "MALAYSIA"
myArray(2,1) = "2710241280"
myArray(2,2) = "2710306815"
myArray(3,0) = "MALAYSIA"
myArray(3,1) = "2710437888"
myArray(3,2) = "2710503423"
myArray(4,0) = "MALAYSIA"
myArray(4,1) = "2854617088"
myArray(4,2) = "2854682623"
myArray(5,0) = "MALAYSIA"
myArray(5,1) = "3236200448"
myArray(5,2) = "3236233215"
myArray(6,0) = "MALAYSIA"
myArray(6,1) = "3262473996"
myArray(6,2) = "3262473996"
(省略其他120个……)
For i = LBound(myArray) to UBound(myArray)
If LongIP > myArray(i,2) And LongIP < myArray(i,1) Then
Response.Redirect("no_access.asp")
End If
Next
%> |