首页 > 编程 > VBScript > 正文

一个实现VBS倒计时的代码

2020-07-26 11:59:58
字体:
来源:转载
供稿:网友

一个实现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 

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表