逻辑结构有问题!
根据下面的代码自己分析- ctr = 0
- do
- ctr = ctr+1
- if ctr = 3 then
- Set Shutdown=WScript.CreateObject("Shell.Application")
- Shutdown.ShutdownWindows
- exit do
- else
- WScript.Sleep (1000*60*60)
- set Wmp = CreateObject("WMPlayer.ocx")
- Wmp.Url = ctr & "hour.mp3"
- do Until Wmp.PlayState = 1
- Wsh.Sleep 1000
- loop
- end if
- loop
复制代码 用while...wend语句更简洁- ctr = 0
- while ctr < 3
- ctr = ctr + 1
- WScript.Sleep 1000*60*60
- set Wmp = CreateObject("WMPlayer.ocx")
- Wmp.Url = ctr & "hour.mp3"
- do Until Wmp.PlayState = 1
- Wsh.Sleep 1000
- loop
- wend
- CreateObject("Shell.Application").ShutdownWindows
复制代码
|