获取ip和地区 返回函数
希望高手能写个 字符串截取我需要这个网页 的ip地址和 和来自区域 两个函数
http://www.ip168.com/json.do?view=myipaddress #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 & @CRLF & $array)
Else
MsgBox(0, '获取失败', '获取失败')
EndIf #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
http://www.ip138.com/ 这里的怎么查?这个稳定些
页:
[1]