What you need to do is write your program that will do everything you need, and then use the built-in task scheduler of your OS to disable it. That would be the most reliable. Windows Task Scheduler, for example, can launch your application before a user logs in, restart the application if necessary, register errors and send notifications, etc.
Otherwise, you will need to run the application 24 hours a day and 7 days a week, as well as conduct a survey over time at regular intervals.
For example, you can change the interval every minute:
timer.Interval = 1000 * 60;
And inside your Elapsed event, check the current time:
static void timer_Elapsed(object sender, ElapsedEventArgs e) { if (DateTime.Now.Hour == 1 && DateTime.Now.Minute == 0) {
But it is really unreliable. Application may crash. And working with DateTime can be tricky.
Grant
source share