28,409
社区成员




Function FindArea(VIP)
on error resume next
dim inIP,inIPnum,inIPs
inIP = VIP
if inIP = "127.0.0.1" then FindArea="保留地址":Exit Function
inIPs = split(inIP,".")
inIPnum = 256*256*256*inips(0) + 256*256*inips(1) + 256*inips(2) + inips(3)
set rsip=server.CreateObject("adodb.recordset")
sqlstr="select top 1 F_StartIP,F_EndIP,F_Intro1,F_Intro2 from T_IPAddress where F_EndIP>="&inipnum&" and F_StartIP<=" & inipnum & " order by F_EndIP-F_StartIP"
rsip.open sqlstr,Conn,1,3
if rsip.eof then
FindArea="未知数据"
else
FindArea=rsip("F_Intro1") & rsip("F_Intro2")
FindArea=Replace(FindArea,"CZ88.NET","")
if instr(Findarea,"未知") then FindArea="未知数据"
end if
End Function