获取 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 上传文件到七牛,纯原生

Delphi windows 编程[17] - 更换菜单: loadmenu、destroymenu、setmenu

Delphi检查程序内存泄露 checkmem.pas

Delphi unigui 获取files路径

Delphi ado 连接 excel (附excel各个版本的版本号)

Delphi 百度输入提示 Delphi 实现

Delphi xe firemonkey的stylebook皮肤控件的使用

Delphi调用winapi: getsystemmetrics - 获取系统度量等数值信息

Delphi 解析系统环境变量

Delphi xe 取得 app 自己的版本号 (狠跨 4 个平台)

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



打赏

取消

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

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

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

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

评论

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