简体   繁体   English

使用Windows服务的计划任务实现

[英]Scheduled Task Implementation Using Windows Service

I need to implement some background components in an enterprise system. 我需要在企业系统中实现一些后台组件。 The components will run at a specific date/time. 组件将在特定日期/时间运行。

What is the best way to implement using Windows Service? 使用Windows服务实现的最佳方法是什么?

I recomment Quartz.NET for this purpose. 我推荐Quartz.NET用于此目的。 To quote the home page: 引用主页:

Quartz.NET is a full-featured, open source job scheduling system that can be used from smallest apps to large scale enterprise systems. Quartz.NET是一个功能齐全的开源作业调度系统,可用于从最小的应用程序到大型企业系统。

We are using it in a few of our products and we have been happy with it so far. 我们在一些产品中使用它,到目前为止我们对此感到满意。 We mostly use it in the exact scenario you describe - as a constantly running Windows service which periodically executes some tasks. 我们主要在您描述的确切场景中使用它 - 作为一个不断运行的Windows服务,它定期执行某些任务。

The documentation is very decent, the API is pleasant to work with. 文档非常体面,API使用起来很愉快。 The features are quite rich (cron triggers, interval triggers, custom calendars, lots of other useful features). 功能非常丰富(cron触发器,间隔触发器,自定义日历,许多其他有用的功能)。 It plays well with UTC and local time (be sure to read the docs!). 它与UTC和当地时间配合得很好(一定要阅读文档!)。

Have you taken a look at Quartz.NET ? 你看过Quartz.NET了吗? Very strong feature set and has been around for awhile. 功能非常强大,已经存在了一段时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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