一个实现vbs倒计时的代码
以下内容为程序代码:
<script language="vbscript">
dim otime : otime = 5
function stime
document.all("oinput").value = "00:00:" & otime
if otime>0 then
otime = otime - 1
window.settimeout "stime", 1000
else
msgbox "时间到了!"
end if
end function
sub window_onload
call stime
end sub
msgbox(value)
</script>
<input id="oinput" type="text">
把上面这段保存为001.html可以成为一个完整的倒计时器,哪位帮我把他改成vbs一下,让其能变成vbs倒计时器!
复制代码 代码如下:
set wshshell = createobject("wscript.shell")
dim closetime,i
closetime = 5
for i = closetime to 1 step - 1
wshshell.popup "当前时间为" & i,1,"计时",0
wscript.sleep 1000
next
msgbox "时间到!"
set wshshell = nothing