看板 Visual_Basic 關於我們 聯絡資訊
Dim FileNo As Integer Dim CurrentLine As String Dim Filename As String Filename = "C:\Documents and Settings\data.txt" ' Define file name FileNo = FreeFile ' Establish free file handle Open Filename For Output As #FileNo ' Open file (writing mode) Print #FileNo, "This is a line of text" ' Save line Print #FileNo, "This is another line of text" ' Save line Close #FileNo ' Close file 請問我要如何才能讓data可以變成是一個變數呢?? 我想用now()函數把每天的檔案存進去~ 請問可行嗎??該怎麼做呢?? 請大家指導一下~~謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.135.251.190
dingyuchi:"C:\Documents and Settings\" & Now() & ".txt" 06/17 08:07
dingyuchi:Now() 出來的東西你還要改一下 因為有些符號不能當檔名 06/17 08:08
fumizuki:Format(Now, "yyyymmdd") 06/17 19:00