找回密码
 加入
搜索
查看: 2754|回复: 3

[网络通信] 获取ip和地区 返回函数

[复制链接]
发表于 2017-2-21 17:50:16 | 显示全部楼层 |阅读模式
悬赏30金钱未解决
希望高手能写个 字符串截取
我需要这个网页 的ip地址和 和来自区域 两个函数
http://www.ip168.com/json.do?view=myipaddress

发表于 2017-2-21 22:51:05 | 显示全部楼层
#NoTrayIcon
#RequireAdmin
#pre_usex64=n
Local $ohttp = ObjCreate('Winhttp.Winhttprequest.5.1')
$ohttp.open('get', 'http://www.ip168.com/json.do?view=myipaddress', 0)
$ohttp.send()
Local $sbody = BinaryToString($ohttp.responsebody(), 4)
Local $array = StringRegExp($sbody, '\[(.*?)\].*?(来自.*?)</ce', 3)
If Not @error Then
        MsgBox(0, '获取成功', $array[0] & @CRLF & $array[1])
Else
        MsgBox(0, '获取失败', '获取失败')
EndIf
发表于 2017-2-21 23:19:38 | 显示全部楼层
#include <IE.au3>
$Form1 = GUICreate("试试内嵌IE", 500, 80)
$oIE = ObjCreate("Shell.Explorer.2")
GUICtrlCreateObj($oIE, 0, 0, 500, 80)
_IENavigate($oIE, "http://www.ip168.com/json.do?view=myipaddress")
_IELoadWait($oIE)
GUISetState(@SW_SHOWNORMAL)
While 1
        Sleep(1)    
        If GUIGetMsg() = -3 Then Exit
WEnd
发表于 2017-2-26 18:58:47 | 显示全部楼层
http://www.ip138.com/ 
这里的怎么查?这个稳定些
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-3-28 21:42 , Processed in 0.078521 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表