国产探花免费观看_亚洲丰满少妇自慰呻吟_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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 江津市| 改则县| 闽清县| 沂南县| 安顺市| 丰都县| 漠河县| 东源县| 临夏县| 扎鲁特旗| 张家界市| 鞍山市| 普格县| 襄樊市| 彰化市| 黎平县| 招远市| 古交市| 陵水| 杂多县| 黎川县| 花莲市| 旌德县| 民和| 苍溪县| 贵德县| 彭水| 河西区| 刚察县| 阳曲县| 山阴县| 松江区| 北宁市| 靖州| 夏河县| 灵石县| 金寨县| 神池县| 九龙城区| 凤台县| 新民市|