国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

Asp限制IP訪問,阻止某一個IP段禁止訪問本站的代

2024-05-04 11:07:28
字體:
來源:轉載
供稿:網友

<%
''獲取訪問者的地址
ip=Request.ServerVariables("REMOTE_ADDR")
''允許的IP地址段為10.0.0.0~10.68.63.255
allowip1="10.0.0.0"
allowip2="10.68.10.71"
response.writecheckip(ip,allowip1,allowip2)
functioncheckip(ip,allowip1,allowip2)
dimcheck(4)
checkip=false
ipstr=split(ip,".")
allow1=split(allowip1,".")
allow2=split(allowip2,".")
ifcint(allow1(0))>cint(allow2(0))then''判斷IP地址段是否合法
response.write"禁止訪問"
exitfunction
endif
fori=0toubound(ipstr)
ifcint(allow1(i))<cint(allow2(i))then
ifcint(allow1(i))=cint(ipstr(i))then
check(i)=true
checkip=true
exitfor
else
ifcint(ipstr(i))<cint(allow2(i))then
check(i)=true
checkip=true
exitfor
else
ifcint(ipstr(i))>cint(allow2(i))then
check(i)=false
checkip=false
exitfor
else
check(i)=true
checkip=true
endif
endif
endif
else
ifcint(allow1(i))>cint(ipstr(i))orcint(allow1(i))<cint(ipstr(i))then
check(i)=false
checkip=false
ifi<>ubound(ipstr)then
exitfor
endif
else
check(i)=true
endif
endif
next
if(check(0)=trueandcheck(1)=trueandcheck(2)=trueandcheck(3)=false)and(cint(allow2(2))>cint(ipstr(2)))then
checkip=true
endif
endfunction
%>

 

 

摘自 WebShell'S Blog

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 锡林郭勒盟| 特克斯县| 许昌市| 黔西| 都昌县| 嘉禾县| 绩溪县| 东宁县| 阜南县| 开化县| 漯河市| 佳木斯市| 荣昌县| 正镶白旗| 芒康县| 皋兰县| 洛浦县| 邯郸县| 东乡| 工布江达县| 家居| 合川市| 玉树县| 卢氏县| 海南省| 二手房| 七台河市| 图木舒克市| 孟州市| 蒙自县| 左云县| 新化县| 仁怀市| 张家口市| 枝江市| 万安县| 康保县| 黔西县| 阿瓦提县| 南安市| 桃江县|