'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