关于日期和读取的一个小问题

来源:百度知道 编辑:UC知道 时间:2024/05/17 09:35:29
有一堆储存的文件命名方式都为年+月+日+时.ini 以系统时间为当前时间
设定两个键 分别是读取上一小时文件 和下一小时文件 怎么显示可以不用管 主要是上下读取那两个键 给点注解 详细点最好 新人 谢谢

Private Sub Timer1_Timer()
Text1 = Year(Date) '年
Text2 = Month(Date) '月
Text3 = Day(Date) '日

Text7 = Weekday(Date) - 1 '星期

Text4 = Hour(Time) '时
Text5 = Minute(Time) '分
Text6 = Second(Time) '秒

If Text7 = "1" Then Text7 = "一"
If Text7 = "2" Then Text7 = "二"
If Text7 = "3" Then Text7 = "三"
If Text7 = "4" Then Text7 = "四"
If Text7 = "5" Then Text7 = "五"
If Text7 = "6" Then Text7 = "六"
If Text7 = "7" Then Text7 = "日"
Form1.Caption = Text1 & "年 " & Text2 & "月 " & Text3 & "日 " _
& "星期" & Text7 & " " _
& Text4 & "点 " & Text5 & "分 " & Text6 & "秒"
End Sub

'这个里面的你可能用得上。