如何使用Windows服务每天在特定时间调用方法? [英] how to use windows service to call method daily on specific time?

查看:173
本文介绍了如何使用Windows服务每天在特定时间调用方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
如何每天在特定时间使用Windows服务调用特定方法?还是有其他替代方法?
实际上,我的功能是每天在特定时间通过短信和电子邮件发送提醒.请帮助我...在此先感谢.....

hi to all,
How to call a particular method daily on specific time using windows service? or is there any alternative way to do this?
Actually my functionality is to send reminder by sms and email on specific time daily. please help me... Thanks in advance.....

推荐答案

您可以使用控制台应用程序而不是Windows服务,并使用计划任务进行调用:

http://msdn.microsoft.com/en-us/library/ms438026.aspx [ ^ ]

http://windows.microsoft.com/en-US/windows7/schedule-a-task [ ^ ]

如果只需要根据计划运行某项内容,则无需为Windows服务实现自己的计划程序来重新发明轮子.
You could use a console application instead of a windows service and call it using a scheduled task:

http://msdn.microsoft.com/en-us/library/ms438026.aspx[^]

http://windows.microsoft.com/en-US/windows7/schedule-a-task[^]

If the requirement is just to run something based on a schedule it doesn''t make sense to reinvent the wheel by implementing your own scheduler for a windows service.


这篇关于如何使用Windows服务每天在特定时间调用方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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