Scheduled task: Service / DLL / Console application
I'm making an asp.NET (C#) website about stock exchange. and I need to perform a scheduled task that runs from sunday to thursday between 10:00-17:00 every 5 mins. (Check for new stocks value, update database, and send emails) - What is the correct / best way to perform it. with console app / dll / service ?
There are good reasons to use the existing task scheduler to launch your application every five minutes.
The most obvious is that task scheduling is not something you want to reimplement yourself if you can avoid it. For instance, you have to be able to deal with time corrections (both manual and automatic).
Additionally, although obviously less of a problem in C#, a badly written application can leak resources of some sort until it shuts down. If the application is expected to terminate on completion of its task then the operating system can generally clean up most resources.
However there are some cases where you might want to have the application running in the background, such as having a lot of state to save between invocations, or otherwise needing prolonged initialisation, or even some sort of real-time monitor.
链接地址: http://www.djcxy.com/p/38888.html上一篇: 是否有计划任务的标准软件?