< %@LANGUAGE="VBSCRIPT " CODEPAGE="65001"%>
<%
Response.charset = „UTF-8“
session.codepage = 65001
session.timeout = 1440
server.scripttimeout = 9999
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns=" http://www.w3.org/1999/xhtml ">
<Kopf>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<title>纯ASP日历</title>
<Stil>
body{font-size:12px; Rand:20px 0 0 20px; Polsterung:0}
tr,td{text-align:center;}
</style>
</head>
<Körper>
<%
'================================
'说明:日历文件
'================================
'取出对应的年月日数据
'=======================
Ryear = CInt(request.querystring("year"))
Rmonth = CInt(request.querystring("month"))
Wenn Ryear = 0 oder Ryear = NULL, dann ist Ryear = Jahr (jetzt)
Wenn Rmonth = 0 oder Rmonth = NULL, dann ist Rmonth = Monat (jetzt)
nowtime = Ryear&"-"&Rmonth&"-1" '得到本月第一天
nowyear = year(nowtime) '年份
nowmonth = Monat(nowtime) '月份
nowweekday = Wochentag(nowtime) - 1 '当前礼拜
'获取2月天数
Februartage = 28
Wenn nowyear / 4 = 0, dann febdays = 29
'获取本月天数
Wenn nowmonth = 1 dann
Monatstage = 31
ElseIf nowmonth = 2 Then
Monatstage = Februartage
ElseIf nowmonth = 3 Then
Monatstage = 31
ElseIf nowmonth = 4 Then
Monatstage = 30
ElseIf nowmonth = 5 Then
Monatstage = 31
ElseIf nowmonth = 6 Then
Monatstage = 30
ElseIf nowmonth = 7 Then
Monatstage = 31
ElseIf nowmonth = 8 Then
Monatstage = 31
ElseIf nowmonth = 9 Then
Monatstage = 30
ElseIf nowmonth = 10 Then
Monatstage = 31
ElseIf nowmonth = 11 Then
Monatstage = 30
Anders
Monatstage = 31
Ende wenn
Calendar = "<a href='calendar.asp?year="&nowyear - 1&"&month="&nowmonth&"'> <<</a> "
willshowmonthmonth = nowmonth
Wenn willshowmonthmonth - 1 <= 0, dann ist willshowmonthmonth = 2
Calendar = Calendar & "<a href='calendar.asp?year="&nowyear&"&month="&willshowmonthmonth - 1&"'> <</a> "
Wenn willshowmonthmonth + 1 > 12, dann ist willshowmonthmonth = 11
Calendar = Calendar & "<a href='calendar.asp?year="&nowyear&"&month="&willshowmonthmonth + 1&"''> ></a> "
Calendar = Calendar & "<a href='calendar.asp?year="&nowyear + 1&"&month="&nowmonth&"'> >></a> "
Calendar = Calendar & "<table bgcolor=#000000 Cellspacing=1 width=200><tr bgcolor=#ffffff><td colspan=7>"&nowyear&"-"&nowmonth&"-"&day(now)&"</td> </tr>"&VBCRLF
Kalender = Kalender & " <tr bgcolor=#ffffff>"&VBCRLF
Calendar = Kalender & "<td>日</td>"&VBCRLF
Calendar = Kalender & "<td>一</td>"&VBCRLF
Calendar = Kalender & "<td>二</td>"&VBCRLF
Calendar = Kalender & "<td>三</td>"&VBCRLF
Calendar = Kalender & "<td>四</td>"&VBCRLF
Calendar = Kalender & "<td>五</td>"&VBCRLF
Calendar = Kalender & "<td>六</td>"&VBCRLF
Kalender = Kalender & "</tr>"&VBCRLF
Kalender = Kalender & VBCRLF&"<tr bgcolor=#ffffff>"&VBCRLF
'http://www.knowsky.com/ 把前面的空白补充出来
nowmonthfirstiweekday = Wochentag(nowyear&"-"&nowmonat&"-1") - 2 '本月第一天的星期
Für i=0 bis nowmonthfirstiweekday
Calendar = Kalender & "<td bgcolor=#efefef> </td>"&VBCRLF
Nächste
'开始循环写日期
t=1
Für i=1 bis Monatstage
If year(now) = year(nowyear&"-"&nowmonth&"-"&i) and day(now) = day(nowyear&"-"&nowmonth&"-"&i) Then '高亮显示今日
calendar = Calendar & "<td bgcolor =#cccccc><a href=''>"&i&"</a></td>"&VBCRLF
Anders
Calendar = Kalender & "<td>"&i&"</td>"&VBCRLF
Ende wenn
wenn Wochentag(nowyear&"-"&nowmonth&"-"&i) = 7 dann
t=t+1
Kalender = Kalender & "</tr><tr bgcolor=#ffffff>"&VBCRLF
Ende wenn
Nächste
Für i=1 bis (7*t-(nowmonthfirstiweekday+1+monthdays))
Kalender = Kalender & "<td bgcolor=#ffffff></td>"&VBCRLF
Nächste
Kalender = Kalender & VBCRLF&"</tr>"
Kalender = Kalender & "</table>"&VBCRLF
Response.Write-Kalender
%>
</body>
</html>