首页 > 程序设计『Programing』 > IP归属地查询器

IP归属地查询器

在线查询数据,数据来源123cha.com。需要联网使用,不是查询的纯真的数据。猛击此处下载。 :D

部分代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
procedure TForm1.Button1Click(Sender: TObject);
var
   xml : OleVariant;
   r:string;
   p1,p2 : Integer;
   I:Integer;
begin
   xml := CreateOleObject('Microsoft.XMLHTTP');
   xml.Open('GET','http://www.123cha.com/ip/?q='+edt1.Text, False);
   xml.Send;
   r := xml.responseText;
   p1:=Pos('数据',r);
   p2:=Pos('<li>[查询提供]',r);
   mmo1.lines.add(' 您查询的地址可能归属地是:') ;
   mmo1.lines.add(' ===========================') ;
   mmo1.Lines.add (Copy(r, p1+16, p2-p1-5));
   mmo1.Text:=StringReplace(mmo1.Text,'&nbsp;','',[rfReplaceAll]);
   mmo1.Text:=StringReplace(mmo1.Text,'</li>','',[rfReplaceAll]);
   mmo1.Text:=StringReplace(mmo1.Text,'<li>','',[rfReplaceAll]);
   mmo1.Text:=StringReplace(mmo1.Text,'<font color="blue">','',[rfReplaceAll]);
   mmo1.Text:=StringReplace(mmo1.Text,'</font>','',[rfReplaceAll]);
end;
</li>

原创文章,转载请注明: 转载自火星信息安全研究院

本文链接地址: IP归属地查询器: http://www.h4ck.org.cn/2010/03/ip/

  1. 还没有评论
评论提交中, 请稍候...

留言

:p 8) :lol: =( :8 ;) :(( :o: :[ :) :D :-| :-[) :bloody: :cool: :choler: :love: :oups: :aie: :beurk:
可以使用的标签: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">
Trackbacks & Pingbacks ( 0 )
  1. 还没有 trackbacks