#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 包在while 1 ...wend 里 qqgghh1 发表于 2012-8-29 15:27
#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))
#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
本版积分规则 发表回复 回帖后跳转到最后一页
|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度
GMT+8, 2024-12-23 03:32 , Processed in 0.108366 second(s), 23 queries .
Powered by Discuz! X3.5 Licensed
© 2001-2024 Discuz! Team.