• ----:)欢迎访问源码网(:----
    • 首页
    • 博客
    • 学院
    • 下载
    • 论坛
    • 影视
    • 发布源码
    • RSS
    • ITPig
    • 笑话网
    • 百家姓
    • 繁體中文

源码网 - 中国第一源码门户
选择镜像:网通镜像 - 电信主站
  • 首 页
  • 新闻动态
  • 网站运营
  • 网页制作
  • WEB开发
  • 编程开发
  • 图像媒体
  • 操作系统
  • 数据库
  • 服务器
热门搜索 优化 SEO 故事 cms IIS7 MySQL 个人 AdSense 主题推广 | 文章搜索: 高级搜索
会员登录/控制面版您的位置: 学院首页 >> WEB开发 >> ASP开发 >> ASP技巧 >> 详细内容
 

推荐文章

 
 

热点文章

  • ASP采集教程基础篇
  • ASP+JS三级联动下拉菜单[调用数据库数据]
  • 根据IP地址自动判断转向分站的代码
  • 如何使ASP程序暂停指定的时间后再继续执行
  • WEB打印大全
  • 同一个空间不同的域名实现访问不同的文件夹
  • 防止网上重复投票的方法
  • 精华ASP代码
  • 小偷程序原理和简单示例
  • Asp限制IP访问
  • ASP自动解压RAR文件
  • 实现页面重定向
 
 

相关文章

  • 检测浏览器是否支持有Flash2.0以上或有Flash插件
  • 用HTML META标签和ASP来作定时迟时信息
  • 怎样计算折扣
  • 计算文件下载时间
  • 动态输入框的三个函数
  • 检测表单输入EMAIL的合法性
  • 多域名同一空间的处理实例
  • 检测整数和长整数的函数
  • 如何使ASP程序暂停指定的时间后再继续执行
  • 使用ASP和Word进行服务器端拼写检查
  • 用ASP在ACCESS中插入图片怎么表示?
  • 生成一个不重复的随即数字
 
 

百度搜索

 
 

Asp限制IP访问

  • 阅览次数:
  • 文章来源: IM286
  • 原文作者: Pkxp
  • 整理日期: 2006-10-03
  • 发表评论
  • 字体大小:
  • 小
  • 中
  • 大

<%
''获取访问者的地址
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
%>

上一篇:从SQL Server导出到MYSQL的简单方法
下一篇:比AcdSee功能还强大的图片处理、编辑软件,推荐下载!
  • 网友评论:
  • 查看所有评论
  • 我要发表评论
您的网名:
留言主题:
你要发表的内容:

 

关于本站 | 广告联系 | 版权声明 | 网站地图 | 发布软件 | 帮助中心 | 源码论坛

Copyright © 2005-2007 CodePub.Com  程序支持:木翼  滇ICP备05005971号