[RESOLVED] how to dynamically add a file name
So I am able to write to a .txt file, but I would like to have the file names change depending on the date when the process is run. How would I do this?
Here is my current code:
VB Code:
Dim oFile As System.IO.File
Dim oWrite As System.IO.StreamWriter
oWrite = oFile.CreateText("C:\New.txt")
oWrite.WriteLine("This is working great.")
oWrite.WriteLine()
Thanks
Re: how to dynamically add a file name
When using dates to identify files, I would suggest you use the format yyyyMMdd, so that sorting the files alphabetically will also sort them chronologically. You would do that something like this:
VB Code:
oWrite = IO.File.CreateText("C:\" & Date.Today.ToString("yyyyMMdd") & ".txt")