~在思考中沉淀~

博客园 首页 新随笔 联系 订阅 管理

在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.”
详细的内容还是见这篇文章吧~~

posted on 2005-03-07 15:57  ~在思考中沉淀~  阅读(2074)  评论(1编辑  收藏  举报