断线关机?[已解决]
本帖最后由 流沙枫 于 2012-8-29 15:50 编辑#include <inet.au3>
Local $var
$var = Ping ("www.baidu.com",250)
If $var Then
MsgBox(0,"状态-成功","收发时间间隔:" & $var & "毫秒")
Sleep(60000)
Else
; MsgBox(0,"状态-失败","错误代码:" & @error)
TrayTip('',"断网",5,1)
run ("shutdown -s -t 60 -c "&chr(34)&"系统网络断开,机器即将关闭"&chr(34))
EndIf怎么返回if循环?
现在只能检测一次.... if 包在while 1 ...wend 里 if 包在while 1 ...wend 里
qqgghh1 发表于 2012-8-29 15:27 http://www.autoitx.com/images/common/back.gif
搞定了,thanks...#include <inet.au3>
Local $var
$var = Ping ("www.baidu.com",250)
While $var
TrayTip('',"连网",5,1)
Sleep(120000)
$var = Ping ("www.baidu.com",250)
WEnd
; MsgBox(0,"状态-失败","错误代码:" & @error)
TrayTip('',"断网",5,1)
run ("shutdown -s -t 60 -c "&chr(34)&"系统网络断开,机器即将关闭"&chr(34)) 回复 3# 流沙枫
晕,好像不对的.... 好像有问题。。。。 本帖最后由 流沙枫 于 2013-6-27 19:15 编辑
#include <inet.au3>
#include <Sound.au3>
Local $var1,$var2
While 1
$var1 = Ping ("202.X.X.X",1000)
$var2 = Ping ("www.baidu.com",1000)
If$var1 And $var2 Then
TrayTip('',"连网",5,1)
;~ Local $sFile=("H:\手机备份\手机玲声\风铃短信(美).mid")
;~ Local $sound =_SoundOpen ( $sFile )
;~ _SoundPlay($sound, 1)
Else
TrayTip('',"断网",5,1)
run ("shutdown -s -t 60 -c "&chr(34)&"系统网络断开,机器即将关闭"&chr(34))
EndIf
Sleep(50000)
WEnd
页:
[1]