纯asp打造的日历程序,可自行美化,这里仅提供最简单的css样式。。。
<style>
Corps {taille de police: 12px;
Tr, td {text-align: centre;}
</ style>
<%
'===========================.
«Explication: fichier de calendrier
'===========================.
'Sortez les données de journal du blog d'année et de mois correspondantes
'=====================.
Ryear = cint (request.querystring ("année")
RMONTH = CINT (request.querystring ("mois")
Si ryear = 0r ryear = null alors ryear = an (maintenant)
Si rmMont = 0 ou RmONTH = NULL, alors rmONTH = MOIS (MAINTENANT)
Maintenant temps = ryear & "-" & rmonth & "-1" '' pour obtenir le premier jour de ce mois
Nowyear = an (maintenant temps) '
Nowmonth = mois (maintenant) 'mois
Nowweekday = Weekday (maintenant) -1 '
'Obtenez le nombre de jours de février
Febdays = 28
Si Nowyear / 4 = 0 Theon Febdays = 29
'Obtenez le nombre de jours ce mois-ci
Si maintenant Month = 1 alors
Journées du mois = 31
Elseif maintenant Month = 2 alors
Jours du mois = février
Elseif maintenant Month = 3 alors
Journées du mois = 31
Elseif maintenant Month = 4 alors
Journées du mois = 30
Elseif maintenant Month = 5 alors
Journées du mois = 31
Elseif maintenant Month = 6 alors
Journées du mois = 30
Elseif maintenant Month = 7 alors
Journées du mois = 31
Elseif maintenant Month = 8 alors
Journées du mois = 31
Elseif maintenant Month = 9 alors
Journées du mois = 30
Elseif Nowmonth = 10 alors
Journées du mois = 31
Elseif maintenant Month = 11 alors
Journées du mois = 30
autre
Journées du mois = 31
terminer si
Calendar = "<a href = 'calendar.asp? Année =" & nowyear - 1 & "& mens =" & nowmonth & "'> & lt; </a> & nbsp;"
Willshowmonthmonth = nowmonth
Si WillShowmonthmonth -1 <= 0 Thatn Willshowmonthmonth = 2
Calendar = Calendar & "<a href = 'calendar.asp? Année =" & Nowyear & "& Month =" & Willshowmonthmonth -1 & lt;
Si WillShowmonthmonth + 1> 12 Thatnshowmonthmonth = 11
Calendar = Calendar & "<a href = 'calendar.asp? Année =" & Nowyear & "& Month =" & Willshowmonth + 1 & gt;
Calendar = Calendar & "<a href = 'calendar.asp? Année =" & nowyear + 1 & mois = "& nowmonth &"'> & gt;
Calendar = calendar & "<Table BgColor = # 000000 CellSpacing = 1 width = 200> <tr bgColor = # ffffff> <td Colspan = 7>" maintenant) & "</td> </tr>" & vbcrf
Calendar = calendar & "<tr bgcolor = # ffffff>" & vbcrlf
Calendar = calendar & "<td> jour </td>" & vbcrlf
Calendar = calendar & "<td> un </td>" & vbcrip
Calendar = calendar & "<td> deux </td>" & vbcrlf
Calendar = calendar & "<td> trois </td>" & vbcrlf
Calendar = calendar & "<td> quatre </td>" & vbcrlf
Calendar = calendar & "<td> cinq </td>" & vbcrlf
Calendar = calendar & "<td> six </td>" & vbcrlf
Calendar = calendar & "</tr>" & vbcrlf
Calendar = calendar & vbcrlf & "<tr bgcolor = # ffffff>" & vbcrlf
'Ajoutez le blanc devant
NowMonthFirstiweekday = Weekday (Nowyear & "-" & Nowmonth & "-1") - 2 'le premier jour du mois ce mois-ci
pour i = 0 à maintenant MonthFirstiweekday
Calendar = calendar & "<td bgcolor = # efefef> & nbsp; </td>" & vbcrlf
suivant
'Commencez la datement
t = 1
pour i = 1 au jour du mois
Si des années (maintenant) = an (Nowyear & "-" & newmonth & "-" & i) et day (maintenant) = jour (Nowear & "-" & nowmonth & "-" & i) puis "mettent en surbrillance aujourd'hui
Calendar = calendar & "<td bgcolor = # cccccc> <a href = '' '>" & i & "</a> </td>"
autre
Calendar = calendar & "<td> & i &" </td> "& vbcrlf
terminer si
Si la semaine (Nowyear & "-" & nowmonth & "-" & i) = 7 alors
t = t + 1
Calendar = calendar & "</tr> <tr bgcolor = # ffffff>" & vbcrlf
terminer si
suivant
Pour i = 1 à (7 * t- (nowmonthfirstiweekday + 1 + les jours du mois)))
Calendar = calendar & "<tdbgcolor = # ffffff> </td>" & vbcrlf
suivant
Calendar = calendar & vbcrlf & "</tr>"
Calendar = calendar & "</pally>" & vbcrip
Réponse.WRITE Calendrier
%>