请教有关以时间为文件名(txt)的读取
问下坛上的高手,我想读取一个类似"20050504.txt"的文件,我用i=format(date(),yyyymmdd)&".txt"来取文件名,得到的是2005-5-4.txt,是为什么,该如何办?
Option Explicit
Private Sub Command1_Click()
Dim strFileName As String
Dim FileNum As Integer
Dim strInput As String
strFileName = Format$(Date, "YYYYMMDD")
'Print strFileName
FileNum = FreeFile()
Open App.Path & "\" & strFileName & ".txt" For Output As #FileNum
Print #FileNum, "梁嘉辉编写"
Close #FileNum
FileNum = FreeFile()
Open App.Path & "\" & strFileName & ".txt" For Input As #FileNum
Input #FileNum, strInput
Close #FileNum
Print strInput
End Sub