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
投稿

猜你喜欢

  • go语言实现将重要数据写入图片中

    2024-02-10 02:15:38
  • 网页常用特效整理:中级篇

    2013-07-15 13:43:32
  • python常见的占位符总结及用法

    2023-10-11 10:39:58
  • python 如何对logging日志封装

    2023-07-06 11:27:36
  • 利用Python计算质数与完全数的方法实例

    2022-12-30 23:35:26
  • Burpsuite模块之Burpsuite Intruder模块详解

    2023-11-24 05:31:24
  • 开发人员一定要加入收藏夹的网站 推荐

    2023-09-14 23:24:43
  • Python3 pandas.concat的用法说明

    2023-11-22 23:46:51
  • python中找出numpy array数组的最值及其索引方法

    2022-11-26 14:24:00
  • 访问和更改关系数据,使用MSSQL外联接

    2024-01-18 06:39:33
  • django 文件上传功能的相关实例代码(简单易懂)

    2023-01-14 03:51:17
  • 如何使用Pycharm连接SQL Sever(详细教程)

    2024-01-18 22:57:41
  • 悟透JavaScript

    2008-05-29 22:15:00
  • django 中的聚合函数,分组函数,F 查询,Q查询

    2021-07-24 02:37:50
  • python使用xlsxwriter实现有向无环图到Excel的转换

    2022-01-24 06:42:54
  • 我的javascript小扎

    2008-08-12 13:04:00
  • vue proxytable代理根路径的同时增加其他代理方式

    2024-05-05 09:09:17
  • 举例讲解Python设计模式编程的代理模式与抽象工厂模式

    2021-08-13 06:23:49
  • Hugo Config模块构建实现源码剖析

    2024-05-09 09:48:03
  • 分享python数据统计的一些小技巧

    2022-08-20 11:24:47
  • asp之家 网络编程 m.aspxhome.com