I have a C # application that performs some maintenance tasks. It should work approximately every hour, although it is not too important if it is turned off a little. And it should run on the Win2003 server without registering.
Basically, I wonder if I should write a Windows service, and if so, if Thread.Sleep () is the right way to pause Thread for an hour or if there are better ways to make sure Thread remains inactive and does not load the server? (aka what is the most opposite of spinlock)
An alternative is the Windows task scheduler, but I'm not sure if this is good for use on the server, because: a) I will need to save the schedule in it, and not in my app.config, b) I cannot easily control the service through start / stop / restart and c) I do not know if the Windows user credentials are as secure as when entering them into the Snapin MMC services.
What are your opinions? Is it possible and useful to have an unoccupied service, or would you recommend a task scheduler?
windows-server-2003 windows-services
Michael stum
source share