获取 IP138 IP 地址


本文整理自网络,侵删。

 uses里面加ComObj 
function GetIP: string; //获取外网IP
var
xml : OleVariant;
r:string;
p1,p2 : Integer;
begin
xml := CreateOleObject('Microsoft.XMLHTTP');
xml.Open('GET','http://www.ip138.com/ip2city.asp', False);
xml.Send;
r := xml.responseText;
p1:=Pos('[',r);
p2:=Pos(']',r);
Result := Copy(r, p1+1, p2-p1-1);
end;

相关阅读 >>

Delphi idftp连不上ftp服务器的解决方法

Delphi 双击listbox1内容,数据插入到memo1/synedit1鼠标指定位置

Delphi android / ios应用程序中使用tgeocoder类进行反向地理编码(从位置信息中获取地址)

Delphi trim删除字符串首尾空格

Delphi - 右滚动文字

Delphi xe5获取android imei id

Delphi {$pointermath on} 方便指针操作的编译指令

Delphi 解决idtcpclient和idtcpserver通信中文乱码问题

Delphi程序常用的公共代码

Delphi 利用csidl打开特殊文件夹

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...