本帖最后由 漫反射 于 2012-9-27 09:31 编辑
Global $oHTTP = ObjCreate("Msxml2.xmlhttp")
$oHTTP.Open("get","http://。。。。)
这样创建之后如何关闭,$oHTTP.close好像不行
--------------------------------------------------------------------
续:#include <INet.au3>
While 1
ConsoleWrite(_GetIP()&@CRLF)
luyouchonglian
Sleep(5000)
WEnd
Func luyouchonglian()
Local $User = "admin"
Local $Passw = "admin"
Local $Gatew = "192.168.1.1"
$oHTTP = ObjCreate("Msxml2.xmlhttp")
$oHTTP.Open("get","http://" & $User & ":" & $Passw & "@" & $Gatew,false)
$oHTTP.Send()
$oHTTP.Open("get","http://192.168.1.1/userRpm/StatusRpm.htm?Disconnect=断%20线&wan=1",false)
$oHTTP.Send()
Sleep(500)
$Log = $oHTTP.responseBody
$oHTTP.Open("get","http://192.168.1.1/userRpm/StatusRpm.htm?Connect=连%20接&wan=1",false)
$oHTTP.Send()
$oHTTP = 0
EndFunc
这段代码是TPLINK路由器断开重连,但只有第一次有用,后面都不会实现重连,除非关掉重开,又只有第一次有用,不知是何原因 |