标题: 发一个VBS版的日历(揍个热闹)
[打印本页]
作者: jmz573515
时间: 2007-2-17 05:01
标题: 发一个VBS版的日历(揍个热闹)
do
m=inputbox ("请输入想查看的月份,输入格式如下:","日历(本程序只对100-1~9999-11有效)",left(date,instrrev(date,"-")-1))
if m="" then wscript.quit
if instr(m,"-")=0 then
msgbox "输入错误,请重新输入。",16+4096,"错误"
elseif IsNumeric(left(m,instr(m,"-")-1))=false or IsNumeric(mid(m,instr(m,"-")+1))=false then
msgbox "输入错误,请重新输入。",16+4096,"错误"
elseif left(m,instr(m,"-")-1)<100 or left(m,instr(m,"-")-1)>9999 then
msgbox "输入错误,请重新输入。",16+4096,"错误"
elseif mid(m,instr(m,"-")+1)>12 or mid(m,instr(m,"-")+1)<1 then
msgbox "输入错误,请重新输入。",16+4096,"错误"
else
cx(m)
end if
loop
function cx(m)
dim riqi(37)
if month(m)<12 then
tianshu=DateDiff("d",m,year(m) & "-" & month(m)+1 & "-1")
else
tianshu=DateDiff("d",m,year(m)+1 & "-1-1")
end if
h=weekday(m & "-1")-1
for i=1 to tianshu
riqi(h+i)=i
next
for n= 0 to h+tianshu
if n mod 7 <>0 then
s=s & riqi(n) & vbtab
else
s=s & riqi(n) & vbcrlf
end if
next
msgbox "日" & vbtab & "一" & vbtab & "二" & vbtab & "三" & vbtab & "四" & vbtab & "五" & vbtab & "六" & vbcrlf & s ,4096,year(m) & "年" & month(m) & "月"
end function
[
Last edited by jmz573515 on 2007-2-16 at 05:33 PM ]
作者: anqing
时间: 2007-2-17 11:01
不错
作者: spiegboy
时间: 2007-2-17 14:31
学习
作者: hdzc
时间: 2007-10-10 14:23
挺好用