asp如何验证IP地址?

时间:2010-06-10 18:37:00 

如何验证IP地址?
 

sub chkIP(boardid) 
   dim rsIP 
   dim ipArr 
   dim ignored 
   dim i 
   dim ip 
   dim sql 
   ip=Request.ServerVariables("REMOTE_ADDR")    
   ignored=false 
   if not isempty(boardid) then    
     sql="select ignoreip from board where boardid="&cstr(boardid) 
     set rsIP=conn.execute(sql) 
     if not (rsIP.eof and rsIP.bof) then 
      if instr(cstr(rsIP("ignoreip")&""),chr(13)&chr(10)) then 
        iparr=split(rsIP("ignoreip"),chr(13)&chr(10)) 
        for i=0 to ubound(iparr) 
          if trim(iparr(i))<>"" and left(ip,len(trim(iparr(i))))=trim(iparr(i)) then 
           ignored=true 
           exit for 
          end if 
        next 
      else 
        iparr=rsIP("ignoreip") 
        if ip=trim(iparr) then 
         ignored=true 
        end if 
      end if 
     end if 
     rsIP.close 
   end if 
   if ignored then 
     response.write "<script language=javascript>window.location.href='ignoreip.htm'</script>" 
   end if 
 end sub

标签:ip,验证
0
投稿

猜你喜欢

  • 为博客增加社会化分享按钮代码

    2010-01-31 16:52:00
  • 如何正确的解决 MySQL中忽略用户的现象

    2008-11-27 16:00:00
  • 网页代码更清晰高效的一些经验

    2008-05-19 12:23:00
  • 详解MySQL数据库中Show命令的用法

    2008-11-27 16:04:00
  • 使用MHTML 解决 data URI scheme 的浏览器兼容问题

    2009-05-11 12:30:00
  • asp如何制作一个防止多次刷新计数的图片计数器?

    2010-06-29 21:28:00
  • CSS布局之浮动(三)自适应

    2008-08-19 12:49:00
  • MySQL UPDATE时主键冲突引发的思考

    2008-06-21 17:00:00
  • Web前端应用十种常用技术

    2010-09-01 20:46:00
  • 比较一下看看自己掌握了多少SQL快捷键

    2009-01-04 14:04:00
  • PHP设计模式之中介者模式浅析

    2023-05-25 04:07:16
  • 纠结于ajax开发中 response的contentType 问题

    2008-12-11 13:46:00
  • 浅析MySQL数据库授权原则

    2009-12-15 09:21:00
  • 深入浅出的SQL server 查询优化

    2010-07-02 20:58:00
  • 解决MySQL 5.0不能使用自动增加字段问题

    2008-12-02 14:30:00
  • ASPJPEG组件简要攻略之水印、缩略图和描边代码

    2008-12-17 12:08:00
  • CSS绝对定位在宽屏分辨率下错位

    2009-07-28 12:24:00
  • JavaScript 获取客户端计算机硬件及系统信息

    2009-01-13 17:59:00
  • 细化解析:MySQL 服务器究竟有多稳定?

    2009-01-14 11:55:00
  • asp截取指定英汉混合字符串_支持中文

    2011-04-19 10:39:00
  • asp之家 网络编程 m.aspxhome.com