Your idea of using a Timer
is good. You could use either the Winforms
Timer
or System.Timers.Timer
. In this case, I will refer to System.Timers.Timer
as I have some code I can base this answer off of.
Anyway, just assign it an Interval
and give an event to fire via Elapsed
. Then in the code that Elapsed
calls, put in your action code. Finally, start the timer wherever you need it and try running it.
If you are using a DateTime
to hold the file data, then you will need to either create a constant number of milliseconds until the next day (not recommended), or do some math using TimeSpan
s (hint: use the constructor to get the time). The TimeSpan
contains a property called 'TotalMilliseconds' that you can use as the Interval
.
I hope this points you in the right direction.