<%
''Get the visitor's address
Ip = Request. ServerVariables ("REMOTE_ADDR ")
''The allowed IP address range is 10.0.0.0 ~ 10.68.63.255
Allowip1 = "10.0.0.0"
Allowip2 = "10.68.10.71"
Response. write checkip (ip, allowip1, allowip2)
Function checkip (ip, allowip1, allowip2)
Dim check (4)
Checkip = false
Ipstr = split (ip ,".")
Allow1 = split (allowip1 ,".")
Allow2 = split (allowip2 ,".")
If cint (allow1 (0)> cint (allow2 (0) then''
Response. write "Access prohibited"
Exit function
End if
For I = 0 to ubound (ipstr)
If cint (allow1 (I) <cint (allow2 (I) then
If cint (allow1 (I) = cint (ipstr (I) then
Check (I) = true
Checkip = true
Exit
Else
If cint (ipstr (I) <cint (allow2 (I) then
Check (I) = true
Checkip = true
Exit
Else
If cint (ipstr (I)> cint (allow2 (I) then
Check (I) = false
Checkip = false
Exit
Else
Check (I) = true
Checkip = true
End if
End if
End if
Else
If cint (allow1 (I)> cint (ipstr (I) or cint (allow1 (I) <cint (ipstr (I) then
Check (I) = false
Checkip = false
If I <> ubound (ipstr) then
Exit
End if
Else
Check (I) = true
End if
End if
Next
If (check (0) = true and check (1) = true and check (2) = true and check (3) = false) and (cint (allow2 (2)> cint (ipstr (2) then
Checkip = true
End if
End function
%>