结合Web Services和Windows Services定期执行Asp.Net代码

在Asp.Net中结合Timer和global.asax中的Application_OnStart事件可以实现在asp.net程序运行过程中定期执行某些任务(例如发送提醒邮件等等)的功能。
(如果有兴趣可以参见破宝的在 ASP.NET 中使用计时器(Timer)
但是这种实现方式Application事件的基础上的,如何能够定期执行Asp.net代码又不必application的支持呢?(例如:“...sending e-mail to selected users in the database every two hours, or regularly analyzing the data in the ASP.NET cache for application health monitoring”)
这篇文章(Combine Web and Windows Services to Run Your ASP.NET Code at Scheduled Intervals)给出了一种实现手段。
也就是使用Windows Services作为定时器,它只负责定期调用实现业务逻辑的Web Services,并且“a Web service can run in the same application context as the rest of your ASP.NET application, it can execute in the same context that your existing code expects.”
详细的内容还是见这篇文章吧~~emsmilep.gif

转载于:https://www.cnblogs.com/andrewbao/archive/2005/03/07/114464.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值