`

HealthCare

阅读更多

Dim Wshell
Set Wshell = CreateObject("Wscript.Shell")

Dim timeWorked, workInterval
workInterval = 40*60

Dim timeBegin, timeEnd
timeBegin = "09:30:00"
timeEnd = "18:30:00"

While 1=1
   
    While DateDiff("n", Time(), timeBegin) > 1
       
        Wshell.run "sleep " & workInterval, 0, True
       
        timeWorked = timeWorked + workInterval
       
        MsgBox("You worked " & workInterval/60 & " minutes, totally worked " & Int(timeWorked/3600) & " hours and " & timeWorked/60 mod 60 &" minutes! Have a rest!!!")
    Wend
   
    timeWorked = 0
    Wshell.run "sleep 3", 0, True
   
Wend

Set WShell = Nothing

Function isWorkingDay ()

    Weekday(Date())
   
    isWorkingDay = True

End Function

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics