📄 findwhere.asp
字号:
<%
function findwhere(ip,islog)
if cstr(ip) = "" then
ip = Request.ServerVariables ("REMOTE_ADDR")
end if
ips=Split(ip,".")
ip1 = CInt(ips(0))
ip2 = CInt(ips(1))
ip3 = CInt(ips(2))
ip4 = CInt(ips(3))
if ip1=10 or ip1=61 or ip1=202 or ip1=210 then
ipfile=cstr(ip1) & ".txt"
else
ipfile="other.txt"
end if
ipfile = server.mappath(ipfile)
Set fobj = CreateObject("Scripting.FileSystemObject")
Set ipf = fobj.OpenTextFile(ipfile)
minip1=0
maxip4=255
minip2=0
maxip5=255
DO While not ipf.AtEndOfStream
ipff=CStr(ipf.Readline)
ipat = Split(ipff,".")
ipwhere = Split(ipff,"__")
if ip1 = Cint(ipat(0)) then
if ip2 >= CInt(ipat(1)) and ip2 <= CInt(ipat(4)) and CInt(ipat(1)) => minip1 and CInt(ipat(4)) =< maxip4 then
maxip1 =CInt(ipat(1))
maxip4 =CInt(ipat(4))
if ip3 >= CInt(ipat(2)) and ip3 <= CInt(ipat(5)) and CInt(ipat(2)) => minip2 and CInt(ipat(5)) <= maxip5 then
maxip2 =CInt(ipat(2))
maxip5 =CInt(ipat(5))
'findwhere = ipwhere(2) & ipwhere(3)
findwhere = ipwhere(2)
end if
end if
end if
Loop
if findwhere ="" then
findwhere = "未知地区"
end if
if cstr(islog)="1" then
savelog(findwhere)
end if
ipf.close
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -