Reputation: 54193
I have a function that I would like to have called every day at 11:59 PM. The console application will be running 24/7.
My first thought was to have a timer run every minutes and check if it is 11 59 PM, but I am wondering if .Net has a better way.
Thanks
Upvotes: 2
Views: 381
Reputation: 16287
Here is the snapshot of the task scheduler, create your console application with some arugments, and then add a task there.
Upvotes: 0
Reputation: 2673
You should use the Windows Service to make this happen automatically. This service should be registered in the services. The windows Service Controller Manager has the timer option to trigger the automatically on particular time.
Upvotes: 1
Reputation: 46018
Console app + Windows scheduled task is the simplest solution.
For a more complex scheduling needs look into Quartz.NET.
Upvotes: 6