jmasterx
jmasterx

Reputation: 54193

Scheduled Events in .NET Console App?

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

Answers (3)

David
David

Reputation: 16287

Here is the snapshot of the task scheduler, create your console application with some arugments, and then add a task there.

enter image description here

Upvotes: 0

Smaug
Smaug

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

Jakub Konecki
Jakub Konecki

Reputation: 46018

Console app + Windows scheduled task is the simplest solution.

For a more complex scheduling needs look into Quartz.NET.

Upvotes: 6

Related Questions