| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 763 人关注过本帖
标题:日历程序,谁能帮我解释下:<% %>之间的代码啊。
只看楼主 加入收藏
菜鸟DIY
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2007-12-22
收藏
 问题点数:0 回复次数:4 
日历程序,谁能帮我解释下:<% %>之间的代码啊。
<%@ Language=VBScript %>
<Html>
<Title>
小日历
</title>
<body>
<%
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 "<center>" & mYear & "年" & mMonth & "月" & "</center><hr>"
%>
<table border=1 align=center><tr>
<td align=right>星期日</td>
<td align=right>星期一</td>
<td align=right>星期二</td>
<td align=right>星期三</td>
<td align=right>星期四</td>
<td align=right>星期五</td>
<td align=right>星期六</td>
</tr><tr>
<%
j=1
    for i=1 to 42
        response.write "<td align=right>"
        if i>=FirstDay(mMonth,mYear) and j<=CountDays(mMonth,mYear) then
            if mDate=j then
        response.write "<font color=blue>" & j & " </font>"
        else
        response.write j
        end if
        j=j+1
        else
        response.write   " ? "
        end if
    response.write "</td>"
        if i mod 7=0 then
        response.write "</tr><tr>"
        end if
    next
   
%>
</tr></table>
</body>
</html>
谁能帮我解释下:<%  %>之间的代码啊。
如J=1代表哪些意思啊。
搜索更多相关主题的帖子: 日历 CountDays Function iYear iMonth 
2008-04-28 08:53
google
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:22
帖 子:3419
专家分:23
注 册:2005-11-1
收藏
得分:0 
<%%>中代码的意思就是循环输出一个日期相关的东西.....

祝天下所有母亲幸福安康!~
2008-04-28 11:31
菜鸟DIY
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2007-12-22
收藏
得分:0 
请详细说明下吗,我看不明白啊。比如J=1是代表什么啊。
2008-04-28 12:20
快速回复:日历程序,谁能帮我解释下:<% %>之间的代码啊。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018930 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved