如何在没有计时器的Windows服务中安排任务 [英] How to schedule a task in windows service without timer

查看:96
本文介绍了如何在没有计时器的Windows服务中安排任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我要在Windows服务中执行任务.它必须在定时的时间内运行.我可以使用计时器来执行此操作,但是现在我想不使用计时器来执行.我该怎么办?有什么解决方案吗?
关于

Hello
I''m going to do a task in windows service. It must be run in pireodic time.I do it with timer, but now i wanna do it without timer.What can i do?Are there any solution for it?
Regards

推荐答案

这取决于您的服务执行的操作.给我们更多的背景知识.
It depends on what your service does. Give us some more back ground.


谢谢你sucram
我的服务必须定期查看数据库(SQL Server)中的一个表.例如,当一行添加到银行时,该服务必须向用户发出警报.
如果是在网络上,则user1在user2的表中插入一行,这时必须为user2显示一条警报,其内容为"Record x add to your table"
Thank you sucram
My Service must see a table in database(Sql server) pireodicly.and for example when a row add to the bank the service must alarm to user.
it is on network, user1 insert a row in table for user2 , at time an alarm must be show for user2 with this text "Record x add to your table"


这篇关于如何在没有计时器的Windows服务中安排任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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