<%
''獲取訪問者的地址
ip = request.servervariables(“遠程_ADDR”)
''允許的ip地址段為10.0.0.0~10.68.63.255
allowip1 =“ 10.0.0.0”
allowip2 =“ 10.68.10.71”
Response.WriteCheckip(IP,Allowip1,Allyip2)
FunctionCheckip(IP,allowip1,allyip2)
Dimcheck(4)
checkip = false
ipstr = split(ip,“。”)
allow1 = split(允許1,“。”)
allow2 = split(允許2,“。”)
ifcint(允許1(0))> cint(allow2(0)),然後'''判斷ip地址段是否合法
響應。寫入“禁止訪問”
出口
Endif
fori = 0toubound(iPSTR)
Ifcint(allow1(i))<cint(allow2(i))
然後,IFCINT(允許1(i))= Cint(ipstr(i))
檢查(i)= true
checkip = true
出口
別的
Ifcint(ipstr(i))<cint(lasy2(i))
檢查(i)= true
checkip = true
出口
別的
然後,Ifcint(ipstr(i))> cint(允許2(i))
檢查(i)= false
checkip = false
出口
別的
檢查(i)= true
checkip = true
Endif
Endif
Endif
別的
然後,IFCINT(允許1(i))> Cint(ipstr(i))orcint(允許1(i))<cint(ipstr(i))
檢查(i)= false
checkip = false
Ifi <> ubound(iPSTR)
出口
Endif
別的
檢查(i)= true
Endif
Endif
下一個
if(check(0)= trueandcheck(1)= trueandcheck(2)= trueandcheck(3)= false)和(cint(允許2(2))> cint(ipstr(2)))
checkip = true
Endif
最終功能
%>