『楼 主』:
发一个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 ]
此帖被 +13 点积分 点击查看详情 评分人:【 redtek 】 | 分数: +10 | 时间:2007-2-17 11:11 | 评分人:【 vkill 】 | 分数: +3 | 时间:2007-2-23 00:41 |
|
|