vbs的任務提醒程序

'Author:MENGFEIYANG

'Time:20110507

'方法使用:Popup 方法


Function   FormateTime(sendTime,Para) '格式化時間
select   case   Para 

case   "1" 
sendTime   =   Right("00"   &   Hour(sendTime),2)   & ":"&   right( "00"   &   minute(sendTime),2)   & ":"&   right( "00"   &   Second(sendTime),2) 

end   select   
FormateTime   =   SendTime 
end   Function 

Function   FormateDate(sendTime,Para) '格式化日期
select   case   Para 
Rem   YYYY年MM月DD日 
case   "1" 
sendTime   =   year(sendTime)   & "年"&   right( "00"   &   month(sendTime),2)   & "月"&   right( "00"   &   day(sendTime),2)& "日 " 
End select
FormateDate   =   SendTime 
end   Function 

'MsgBox FormateDate(date(), "1") 


'MsgBox FormateTime(time(), "1") 


Dim a,b,c,d,x,y,i,k,t,dt,MyWeekDay,user'定義變量

MyWeekDay = Weekday(date) 

Select case MyWeekDay

Case 1 MyWeekDay = "星期日"

Case 2 MyWeekDay = "星期一"

Case 3 MyWeekDay = "星期二"

Case 4 MyWeekDay = "星期三"

Case 5 MyWeekDay = "星期四"

Case 6 MyWeekDay = "星期五"

Case 7 MyWeekDay = "星期六"

End select

'MsgBox MyWeekDay 

t = FormateTime(time(), "1") 

dt = FormateDate(date(), "1")

user = InputBox ("請輸入您的用戶名:","用戶名輸入","飛陽123")

If user = "" Then 

user = "Null"

End If

d = InputBox("請輸入您要提醒的事件:"&vbCrLf&vbCrLf&"當前時間爲:"&t&vbCrLf&vbcrlf&"今天日期是:"&dt&" "&MyWeekDay&vbcrlf,"提示","無提醒事件")

If d = "" Then 

d = "無提醒事件"

End If

a = Mid(t,1,2)'獲取當前小時

b = Split(t,":",-1,1)

c = b(1)'獲取當前分鐘

i = Right(t,2)'獲取當前秒數

For x = a To 24 Step + 1 '小時循環

  For y = c To 59 Step + 1 '分鐘循環
  
    For z = i to 59 step +1 '每數60次y加1
        
k = CreateObject("wscript.shell").popup ("今天日期爲:"&dt&" "&MyWeekDay&vbcrlf&vbcrlf&"如今時間爲:"&x&" 時 "&y&" 分 "&z&" 秒"&vbCrLf&vbcrlf&"提醒事件爲:"&d,1,user&"的簡易時鐘",64) '每1秒點擊1次肯定

Select Case k

Case 1 WScript.Quit

End select

    Next
    
    i = Right(Time,2)'校訂當前秒數
    
  Next

Next
相關文章
相關標籤/搜索