简体   繁体   中英

Scheduler program in C#

I am working on a client server project. Client is built in WPF using mvvm pattern and service is built using WCF. I have to perform some action on a specific event which I am able to do by calling some service functions. I will have to do call the same function on a regular basis at a specific time as configured in database. Can somebody suggest a better approach to achieve this. I am thinking of creating a windows service specifically to do such things. Is that a good choice ? Thanks a lot.

Create a console app that calls the service, and add a scheduled task in Windows to run the console app at a specified interval. It is a lot easier and cleaner than creating a service for such a simple application.

I think the best approach is to use an already created (and properly tested) scheduling system or library instead of developing your own. For a Java project I worked on, I used the Quartz library, which handled the job quite nicely and it integrated easily into said project. It has a .NET port here , never used it but I suppose it works similarly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM