设为首页
加入收藏
繁體中文
首 页客家风情客家影音山歌在线客家商城聊天室留言墙测字算命下载中心IT 技术客家论坛
您当前的位置:客家网 | 天南地北客家人 -> IT 技术-> ASP -> 正文 退出登录 用户管理
栏目导航
· ASP · JSP
· 网络安全 · NET专区
· XML专区 · PHP专区
热门文章
· ASP+JavaScript的完整的..
· [图文] 防范非法用户的侵..
· ASP从数据库中获取文件..
· 网络管理中的常用命令
· [图文] 千年虫二世诞生业..
· [图文] FSO组件操作实例..
· 网络常见木马的手工清除..
· 利用ASP远程获取内容
· [图文] 简单购物车教程
· 一个ASP(VBScript)简..
· asp常用数据库连接方法..
· 网络常见木马的手工清除..
相关文章
· php和asp对象的等价关系..
· [图文] Classes and Obje..
· 十天学会ASP之第八天
· 十天学会ASP之第九天
· 十天学会ASP之第十天
· 在ASP中用集合成批操..
· 在ASP中用集合成批操..
· 关于Win2K3中利用ASP上传..
· ASP讲座之一:网页开发利..
· ASP讲座之二:读取通过表..
· ASP讲座之三:Applicati..
· ASP讲座之四:ASP内置组..
· ASP讲座之五:ASP组件(..
· ASP讲座之六:ASP与数据..
· ASP讲座之七:ASP与数据..
asp中对ip进行过滤限制函数
作者:无从考证  来源:不详  发布时间:2007-3-14 15:30:19  发布人:Admin

减小字体 增大字体

<%
’获取访问者的地址
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 "IP地址段出错!"
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
%>

[] [返回上一页] [打 印] [收 藏]
∷相关文章评论∷    (评论内容只代表网友观点,与本站立场无关!) [更多评论…]
关于本站 - 网站合作 - 免责声明 - 友情连接 - 网站地图 - 客家论坛
本站部份内容来自网络 如无意中侵犯了您的权利 请及时与我们联系 我们会尽快处理
Copyright © 2006-2008 天南地北客家人
Email:yddlts@126.com  QQ:153161602
站长:大浪淘沙    QQ群:33754730
粤ICP备07019796号