D
Dirk Reske
Sorry because the date....I changed it back....
if (this.FileCreateDate.Date < DateTime.Today.Date)
//create new file
else
//write to the open File
Nicholas Paldino said:Dirk,
How do you log the events? I'm assuming that you have one API call (or
a limited handful) which manages how the log file is opened, and then
written to.
All you have to do when you make the call is check the filename of the
file stream you have open (if you keep it open all the time). If it doesn't
match with the time the call is made, then close it and open a new one.
You can get the filename by calling the ToString method on the current
DateTime, passing the following format:
yyyyMMdd
This will also have the effect of making the files sortable by date.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
dateDirk Reske said:Hello,
I write an app that, logs events.
how can I make, that everyday a new file whould be createt, with theas
name?
thx