在数据库里有四个字段ip1和ip2、sip1和sip2。后两个是202.96.0.1,202.96.0.255
前两个3395289088,3395289342。知道前两个的含义吗?
function LockIP(sip)
dim str1,str2,str3,str4
dim num
LockIP=false
if isnumeric(left(sip,2)) then
str1=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str2=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str3=left(sip,instr(sip,".")-1)
str4=mid(sip,instr(sip,".")+1)
if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then
else
num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
sql="select count(*) from 9j455noip where ip1 <="&num&" and ip2 >="&num&""
set rs_ip=conn.execute(sql)
if rs_ip(0)>0 then
lockip=true
end if
set rs_ip=nothing
end if
end if
end function%>