本帖最后由 xyold1 于 2010-9-17 19:43 编辑
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 290, 124, 474, 341)
$Label1 = GUICtrlCreateLabel("", 32, 32, 212, 44)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister ( "pingA" ,1500 )
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func PingA()
$var = Ping("autoitx.com",600)
If $var Then; 还可以: If @error = 0 Then ...
$Msg="状态-成功"&"收发时间间隔:" & $var & "毫秒"
Else
$Msg="状态-失败"&"错误代码:" & @error
EndIf
GUICtrlSetData($Label1,$Msg)
EndFunc
|