【www.gdgbn.com--年历日历挂历模板】

星期日
星期一
星期二
星期三
星期四
星期五
星期六
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
 
 
 
 
 
 
 
 
 
 
源码:
<%@ Language=VBScript %>

<br />小日历<br />

<%
Function CountDays(iMonth,iYear)
Select Case iMonth
case 1,3,5,7,8,10,12
CountDays=31
case 2
if IsDate("2/29/" & iYear) Then
CountDays=29
else
CountDays=28
end if
case 4,6,9,11
CountDays=30
End Select
End Function
Function FirstDay(iMonth,iYear)
FirstDay=WeekDay(iMonth & "/1/" & iYear)
End Function
dim mMonth,mYear
mMonth=Month(Date())
mYear=Year(Date())
mDate=Day(Date())
response.write "
" & mYear & "年" & mMonth & "月" & "

"
%>

星期日
星期一
星期二
星期三
星期四
星期五
星期六

<%
j=1
for i=1 to 42
response.write ""
if i>=FirstDay(mMonth,mYear) and j<=CountDays(mMonth,mYear) then
if mDate=j then
response.write "" & j & " "
else
response.write j
end if
j=j+1
else
response.write "   "
end if
response.write ""
if i mod 7=0 then
response.write ""
end if
next
%>



      由于下吧学习频道浏览页面为html页面,因此无法演示正常的asp代码效果。上面给出的演示,为代码通过iis解释后的一种情况。用户可以通过代码复制,自行测试效果。

本文来源:http://www.gdgbn.com/ps/8036/