- <%
- ''获取访问者的地址
- 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
- %>
1 本网站名称:米米素材网
2 本站永久网址:https://www.mimisucai.cn
3 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权进行删除处理。
4 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
5 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
6 本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
2 本站永久网址:https://www.mimisucai.cn
3 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权进行删除处理。
4 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
5 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
6 本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
发表评论