RT.
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 LockIP where ip1 <="&num&" and ip2 >="&num&""
set rs=conn.execute(sql)
if rs(0)>0 then
LockIP=true
end if
set rs=nothing
end if
end if
end function
还有就是,我现在已经有一张全国的IP对应的地址这样的表.字段为开始IP.结束IP.对应城市名.那里IP全是十进制的像798588928这样的数字,
有人说用cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1这个表达式可以把IP转化为十进制吗?
请明白的讲下.谢谢!
问题补充:这个function代码是放在前台页面吗?,还是放在哪?如果放在前台页台,我后台怎么调用呢?它的返回值应该是个长整型吧,还是什么?这段代码放哪里.怎么调用.谢谢.!!
长风秋雁
慕虎7371278
猛跑小猪
相关分类