c#为特定日期安排windows服务 [英] c# schedule windows service for specific date(s)

查看:25
本文介绍了c#为特定日期安排windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看过很多帖子来为每日/每周等时间表配置 Windows 服务,但是如果我想要一个不统一的时间表,我该如何从 Windows 服务的角度进行管理?我有一个应用程序,我想在特定时间运行.以统一的时间表运行它对我没有任何好处,只会浪费资源.我可以使用一些 XML 文件或 windows 服务配置来配置它吗?

I have seen a lot of posts to configure a windows service for daily/weekly etc schedules, but if I want a schedule that is not uniform, how do I manage that from a windows-service perspective? I have an app that I want to run at particular times. Running it at a uniform schedule wouldn't do me any good and just waste resources. Can I configure it by using some XML file, or windows service configuration?

推荐答案

您有三个选择.

  1. 看看 Quartz.net

使用 Windows 调度程序.只需为您需要运行应用程序的每个日期/时间设置不同的时间表".

Use Windows scheduler. Just have a different "schedule" for each date/time you need the app to run.

自己写.

这篇关于c#为特定日期安排windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆