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

首頁 > 編程 > ASP > 正文

Asp下實(shí)現(xiàn)限制IP訪問的程序代碼

2024-05-04 10:58:03
字體:
供稿:網(wǎng)友
<%
''獲取訪問者的地址
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.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 ''判斷IP地址段是否合法
response.write "禁止訪問"
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 for
else
if cint(ipstr(i))<cint(allow2(i)) then
check(i)=true
checkip=true
exit for
else
if cint(ipstr(i))>cint(allow2(i)) then
check(i)=false
checkip=false
exit for
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 for
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
%>

您可能感興趣的文章:

ASP.net做的IP訪問限制用ASP代碼實(shí)現(xiàn)對IP的訪問限制的代碼用asp腳本實(shí)現(xiàn)限制IP訪問推薦的用Asp實(shí)現(xiàn)屏蔽IP地址訪問的代碼ADSI+ASP添加IP到IIS禁止訪問列表中記錄游客頁面訪問IP的簡易實(shí)現(xiàn)代碼 (asp.net+txt)通過ASP禁止指定IP和只允許指定IP訪問網(wǎng)站的代碼Asp限制IP訪問 阻止某一個IP段禁止訪問本站的代碼asp實(shí)現(xiàn)限制一個ip只能訪問一次的方法
發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 厦门市| 临高县| 临海市| 苏尼特左旗| 高安市| 清流县| 和林格尔县| 江西省| 襄汾县| 晋宁县| 宁河县| 邮箱| 武义县| 双峰县| 施秉县| 犍为县| 齐齐哈尔市| 乌兰察布市| 福鼎市| 新郑市| 新平| 昌图县| 平度市| 南漳县| 玉田县| 任丘市| 五常市| 张北县| 梨树县| 沽源县| 宕昌县| 祁东县| 廉江市| 新巴尔虎左旗| 崇仁县| 新竹市| 和龙市| 西峡县| 龙川县| 岳西县| 贺兰县|