VBS計時器


用VBS實現一個以分鍾為單位的計時器:

 1 rem msgbox now 'now is the system para
 2 
 3 msgbox "Timer",,"CreatedByXuTao"
 4 dim limit  5 limit = int(inputbox("Set your time in minutes!",,Setting))  6 
 7 dim a,b,c '保證只提醒一次
 8 a=0
 9 b=0
10 c=0
11 
12 dim cur 13 cur = 0
14 
15 m = hour(now)*60 + minute(now) 16 
17 while cur<limit 18 
19 cur = hour(now)*60+minute(now) - m 20 Wscript.sleep 10000
21 
22 if limit-cur=10 and a=0 then
23 msgbox "10 Minutes Left!",,"Warnning"
24 a=1
25 elseif limit-cur=5 and b=0 then
26 msgbox "5 Minutes Left!",,"Warnning"
27 b=1
28 elseif limit-cur=1 and c=0 then
29 msgbox "1 Minute Left!",,"Warnning"
30 c=1
31 end if
32 
33 wend 34 
35 msgbox "Time is up!",,"OVER"

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM