C# 非周期性事件生成
我的数据库中有一个“约会”事件列表,例如下午 3:00 等,并且它们的间隔不规则,例如 15 分钟后一次,30 分钟后一次,25 分钟后一次。一种方法是我运行一个线程/计时器,每分钟检查数据库是否是下一次约会的分钟。我想要一些其他机制,通过它我可以在下一个保存的时间触发警报/事件/操作在我的数据库中...该怎么做...
i have a list of events "Appointments" in my database, like at 3:00pm etc, and they have irregular intervals like one after 15 mins and next after 30 mins and next after 25 mins. One way is that i run a thread/timer that checks the database every minute whether it is the minute of next appointment or not.. i want some other mechanism by which i can trigger an alert/event/action on the next saved time that is in my database... how to do it...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该查看 Quartz.NET。
来自 Quartz.Net 的功能:
You should take a look at Quartz.NET.
From the Features of Quartz.Net:
获取数据库中下一个约会的日期/时间,从 DateTime.Now 中减去以获得 TimeSpan,然后使用该时间跨度触发计时器一次,类似于:
Get the date/time of the next appointment in the database, subtract from that DateTime.Now in order to get a TimeSpan, and then use that timespan to fire the timer once, similar to this:
计时器类
Timer Class