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

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

 更新時(shí)間: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
%>

相關(guān)文章

最新評(píng)論

牙克石市| 肥西县| 柘城县| 阆中市| 金沙县| 云梦县| 通渭县| 赣州市| 台中市| 滦南县| 长子县| 平南县| 长宁县| 会东县| 萨迦县| 正安县| 台北市| 孟村| 肥乡县| 莫力| 普兰县| 永兴县| 鸡西市| 花莲县| 全州县| 乌海市| 安宁市| 建瓯市| 彰化县| 桂平市| 南郑县| 镇赉县| 徐闻县| 巫溪县| 彭阳县| 耒阳市| 略阳县| 奎屯市| 开鲁县| 历史| 合水县|