ASP找出每个月星期六是几号
ASP用的Vscript脚本语音写的,想请教高手我想找出一年中每个星期六是几号,并且用EXECL导出来,年份是随机的,麻烦了。谢谢
[解决办法]
<script type="text/vbscript">
Dim y, d, i, ex
y = 2012
d = CDate(CStr(y) & "-1-1")
Set ex = CreateObject("Excel.Application")
ex.workbooks.Open "d:\\1.xls"
ex.Sheets("sheet1").Select
i = 1
Do While 1
If Weekday(d) = vbSaturday Then
ex.ActiveSheet.Cells(i, 1) = d
i = i + 1
End If
d = d + 1
If year(d) > y Then
Exit Do
End If
Loop
ex.workbooks("1.xls").save
ex.quit
Set ex = Nothing
MsgBox "ok"
</script>