, , DateTime.Today DateTime.Now. DateTime.Today - , DateTime.Now, , (00:00).
DateTime.Now.ToString("yyyyMMddHH") "2010032211"
DateTime.Today.ToString("yyyyMMddHH") "201032200" ( )
In the case DateTime.Todayyou will see the same value, regardless of the time of day. That's why you only get the first file created, since your code will only create a unique file name every day, not every hour.
Change DateTime.Todayto DateTime.Nowand your problem will be solved.
source
share