First of all you will need to create a windows service: http://msdn.microsoft.com/en-us/library/zt39148a.aspx
Quartz.NET has a useful tutorial here: http://quartznet.sourceforge.net/tutorial/lesson_1.html
What I would do would be to initialize your scheduler in the OnStart()
override and eventually stop it in the OnStop()
.
Basically you can define triggers using the Trigger
class and Jobs by creating an implementation of the IJob
interface, then use the scheduler to attach triggers to jobs. Everytime a trigger fires, the Execute
method of the Job is run.
Putting the entire explanation here would be way too long, but following the tutorials should get you where you want to be in matter of minutes. Good luck!
Of the other end, there is a much simpler solution than writing a windows service. Just write a console app and then, through the Task Scheduler interface (Control Panel -> Administrative Tools in Win 7), create a task that runs your app at the time you want. For a simple task that needs to run once a day this is probably a better solution rather than keeping a service up 24/7.