最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時間:2007年04月03日 00:00:00   作者:  
<%
''獲取訪問者的地址
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
%>

相關文章

最新評論

开鲁县| 衡阳市| 怀化市| 三河市| 佛冈县| 灵璧县| 泸溪县| 永春县| 洪雅县| 宜君县| 樟树市| 嘉义县| 德兴市| 西吉县| 长葛市| 新晃| 望江县| 达尔| 南丰县| 大丰市| 景洪市| 施秉县| 富民县| 张家界市| 上林县| 黑龙江省| 邻水| 华蓥市| 泰安市| 临清市| 吴江市| 获嘉县| 张家口市| 波密县| 新泰市| 南昌县| 安仁县| 廊坊市| 郴州市| 山丹县| 北流市|