首页| 新闻| 娱乐| 游戏| 科普| 文学| 编程| 系统| 数据库| 建站| 学院| 产品| 网管| 维修| 办公| 热点
看了一些ip限制的函数,觉得太复杂。所以,试着写了一个,比较简单。请网友参考指教。谢谢!~
代码拷贝框<%'获取访问者的地址ip=Request.ServerVariables("REMOTE_ADDR") '允许的IP地址段为10.0.0.0~10.68.63.255allowip1="10.0.0.0"allowip2="10.68.10.71"response.write checkip(ip,allowip1,allowip2)function checkip(ip,allowip1,allowip2)dim check(4)checkip=falseipstr=split(ip,".")allow1=split(allowip1,".")allow2=split(allowip2,".")if cint(allow1(0))>cint(allow2(0)) then '判断IP地址段是否合法response.write "IP地址段出错!"exit functionend iffor i=0 to ubound(ipstr)if cint(allow1(i))<cint(allow2(i)) thenif cint(allow1(i))=cint(ipstr(i)) thencheck(i)=truecheckip=trueexit forelseif cint(ipstr(i))<cint(allow2(i)) thencheck(i)=truecheckip=trueexit forelseif cint(ipstr(i))>cint(allow2(i)) thencheck(i)=falsecheckip=falseexit forelsecheck(i)=truecheckip=trueend ifend ifend ifelseif cint(allow1(i))>cint(ipstr(i)) or cint(allow1(i))<cint(ipstr(i)) thencheck(i)=falsecheckip=falseif i<>ubound(ipstr) thenexit forend ifelsecheck(i)=trueend ifend ifnextif (check(0)=true and check(1)=true and check(2)=true and check(3)=false) and (cint(allow2(2))>cint(ipstr(2))) thencheckip=trueend ifend function%>
索泰发布一款GTX 1070 Mini迷
AMD新旗舰显卡轻松干翻NVIDIA
索泰发布一款GTX 1070 Mini迷你版本:小机
芭蕾舞蹈表演,真实美到极致
下午茶时间,悠然自得的休憩
充斥这繁华奢靡气息的城市迪拜风景图片
从山间到田野再到大海美丽的自然风景图片
肉食主义者的最爱美食烤肉图片
夏日甜心草莓美食图片
人逢知己千杯少,喝酒搞笑图集
搞笑试卷,学生恶搞答题
新闻热点
疑难解答
图片精选
使用ASP建设私人搜索引擎
华为短消息中心的发展与应用
移动通信计费及客户服务系统
移动客户服务中心系统
网友关注