上一篇:ASP自定义函数,仿VBA中域函数DLookup >>
asp中对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%>
下一篇:让ASP程序运行于非Windows平台 >>
相关文章:
- · ASP模板类[实现一维循环和二维循环,可以从文件、数据库、变量取摸板]
- · 各种存储过程使用指南
- · 树型结构在ASP中的简单解决
- · 用ASPJPEG组件制作图片的缩略图和加水印
- · 用asp制作强大的搜索引擎(一)
- · VBscript和javascript的选择
- · 在ASP中使用SQL语句之2:用WHERE子句设置查询条件
- · 在线压缩WINRAR文件
- · 在线解压缩上传的WINRAR文件
- · 用javascript实现的日历
- · 在表单里使用”post”和”get”有什么区别
- · 如何把ASP编写成DLL
- · ASP计数器设计详解(转载)
- · 统计在线人数、每日访问人数和总人数
- · 如何动态ASP文件
- · 用asp打开光驱!
- · asp分页显示详论
- · 面向对象的ASP技术:思考与实践
- · 如何获得真实的ip
- · 对文件夹操作2
- · 对文件的操作1
- · 全面优化ASP应用程序的性能(转载)
- · 测试访问者电脑的分辨率
- · 让你的ASP运行于非Windows平台
- · 用ASP编程实现快速查找
- · Calculator
- · ASP导出Excel数据的四种方法
- · ASP编程中15个非常有用的例子
- · 改进ASP应用程序中的字符串处理性能
- · 保护你的ASP页面的两种办法
- · ASP如何获取真实IP地址
- · 关于<SELECT>的无限级联(省|市|县|乡|村|...)
- · 一个简单的计数器和流量统计程序
- · 最简洁的多重查询的解决方案
- · 让上传变的简简单单
- · Microsoft Word 对象
- · ASP操作Excel技术总结
- · 图片上传前取得尺寸
