如何驗證IP地址
來源:易賢網(wǎng) 閱讀:1369 次 日期:2014-08-09 15:21:42
溫馨提示:易賢網(wǎng)小編為您整理了“如何驗證IP地址”,方便廣大網(wǎng)友查閱!

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

更多信息請查看IT技術(shù)專欄

更多信息請查看網(wǎng)絡(luò)編程
易賢網(wǎng)手機網(wǎng)站地址:如何驗證IP地址
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點

版權(quán)所有:易賢網(wǎng)