• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >ASP > Asp下实现限制IP访问的程序代码

Asp下实现限制IP访问的程序代码

作者: 字体:[增加 减小] 来源:互联网 时间:2017-05-11

通过本文主要向大家介绍了asp 客户端ip,asp 获取ip,asp获取ip地址,asp获取客户端ip,asp ip访问限制等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
<%
''获取访问者的地址
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
%> </div>
分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • 通过客户端验证上传图片文件大小的ASP源码
  • asp获取客户端某一个图片的x,y坐标的代码
  • asp下取得客户端IP地址函数 转换IP地址函数
  • Asp下实现限制IP访问的程序代码
  • ASP中实现限制IP的函数详解

相关文章

  • 2017-05-11很有用的学习ASP常用到的代码第1/2页
  • 2017-05-11ASP小偷(远程数据获取)程序的入门教程
  • 2017-05-11很不错的一个UBB代码
  • 2017-05-11asp ajax注册验证之 防止用户名输入空格
  • 2017-05-11asp万用分页程序代码
  • 2017-05-11asp下IP地址分段计算函数
  • 2017-05-11统计在线人数 dxy
  • 2017-05-11asp下实现字符串的补充fill()
  • 2017-05-11ASP下Cookie操作的详细讲解
  • 2017-05-11打包上传asp网站

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • 防止网站被采集的理论分析以及十条方法对策第1/2页
    • asp批量生成大量规律性文本内容的代码
    • 用SQL批量插入数据的存储过程
    • asp定时生成静态HTML的代码
    • ADSI+ASP添加IP到IIS禁止访问列表中
    • ASP的URLDecode函数URLEncode解码函数
    • FpHtmlEnCode 函数之标题过滤特殊符号的代码
    • ASP ajax分页教程一
    • 在Asp程序中取得表单所有内容的代码
    • 再来个专门为google量身定做的sitemap生成代码,(可是动态的哦)

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有