VB6 log txt









ref https://stackoverflow.com/questions/21108664/how-to-create-txt-file


Public Sub Log(msg As String)

Dim iFileNo As Integer
iFileNo = FreeFile
'open the file for writing
Open "D:\Test.txt" For Append As #iFileNo
'please note, if this file already exists it will be overwritten!
'write some example text to the file

Print #iFileNo, Format(Now, "HH:nn:ss") & "." & Right(Format(Timer, "#0.00"), 2) + "  " + msg

'close the file (if you dont do this, you wont be able to open it again!)
Close #iFileNo

End Sub




留言

熱門文章