打印本文 打印本文  关闭窗口 关闭窗口
全球IP地址查询完整版
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005/9/10 13:41:14
0 or len(thr)>3 or len(fou)=0 or len(fou)>3 then

  Response.Write  "<p align=center>"&listip&"<br>"&" <font size=2 >非有效的IP地址,IP每段必须1~3位!</p>"

  

  else

  

    '判断是否为保留地址

     if ((fir>=0) and  (fir<= 2)) or ((fir>=58) and (fir<=60)) or ((fir>=67) and (fir<=126)) then

     Response.Write  "<p align=center>"&listip&"<br>"&" <font size=2 >Internet IP保留地址!</p>"

      

     else

     

        '判断是否为分配地址

        if (fir>=219 and fir<=223) or fir=225 then

        Response.Write  "<p align=center>"&listip&"<br>"&" <font size=2 >此IP地址尚未分配!</p>"

        else

        if fir>255 or fir<0 or sec>255 or sec<0 or thr>255 or thr<0 or fou>255 or fou<0 then

       Response.Write  "<p align=center>"&listip&"<br>"&" <font size=2 >Internet IP地址输入值不正确!</p>"

       else

        

       '查询IP地址数据库

        Set sql= Server.CreateObject("ADODB.Recordset")

                        rs1="select id,startip,endip,country,local from ip where id<9904 and newid="&fir&" and secondid="&sec&" "

                         sql.open rs1,ip,1,1

          '对于类似224.000.000.000~224.255.255.255的ip地址进行处理

          if sql.RecordCount = 1 then   

           sql.Close

        sqlcmd2="select id,startip,endip,country,local from ip where id<9904 and newid="&fir&" and secondid="&sec&" order by id desc"

         set rs=ip.execute(sqlcmd2)

          else

          sqlcmd2="select id,startip,endip,country,local from ip where id<9904 and newid="&fir&" order by id desc"

          set rs=ip.execute(sqlcmd2)

             if rs.eof then

          %>

        <br><br><font size="2"><P align=center><%=listip%><br>★未知IP数据★<BR>如果你知道请告诉我!OICQ:30763914 谢谢!<BR>=尥蹶子=</font></P>

         <% else

          do while not rs.eof

           '*******处理country  or  local为空的情况,使用了按id倒排(why?因为根据IP地址表可知,先列大地区的ip段,例如先列出欧洲的062.000.000.000~062.255.255.255,再列英国等IP段)

           '对后面三段IP进行处理,是否在IP表内

            if  (sec>=(mid(rs("startip"),5,3)) and (sec<=mid(rs("endip"),5,3))) and (thr>=(mid(rs("startip"),9,3)) and (thr<=mid(rs("endip"),9,3))) and (fou>=(mid(rs("startip"),13,3)) and (fou<=mid(rs("endip"),13,3)))  then

             %>  

           <center><font size=2><%=listip%><br><%=rs("country")%>&nbsp;&nbsp;<%=rs("local")%></font></center>

           <%

               '若查到数据,马上跳出以免占用资源

                          exit do

               else

            

              end if

              if rs.eof then

              '如果没有打出提示

              %>

              <br><br><font size="2"><P align=center><%=listip%><br>★未知IP数据★<BR>如果你知道请告诉我!OICQ:30763914 谢谢!<BR>=尥蹶子=</font></P>

            <%

             end if

              rs.movenext

          loop

          

          end if

         end if

          %>

            

      

     <%

      end if

end if%>

     <%end if%>

     <%end if%>

     <%end if%>

     <%end if%><%end if%>

</BODY>

</HTML>


上一页  [1] [2] 



打印本文 打印本文  关闭窗口 关闭窗口