结合Web Services和Windows Services定期执行Asp.Net代码
2005-03-07 15:57
357 查看
在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.”
详细的内容还是见这篇文章吧~~
(如果有兴趣可以参见破宝的在 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.”
详细的内容还是见这篇文章吧~~
相关文章推荐
- 【asp.net 】使用js结合hidden控件实现在后台运行一段程序后提示确认,确认通过后继续执行后台代码~~~
- https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题
- C#ASP.NET执行BAT批处理代码
- 如何让asp.net应用程序定时自动执行代码
- asp.net中的后台按钮如何先执行前台验证再执行后台代码
- ASP.Net执行cmd命令的实现代码
- asp.net中的后台按钮如何先执行前台验证再执行后台代码
- asp.net 结合mysql存储过程进行分页代码
- [ASP.NET]Asp.net取得页面执行时间的代码
- ASP.NET(C#) 定时执行一段代码
- 让服务器控件执行js与C#两种代码(asp.net)
- 如何让asp.net应用程序定时自动执行代码
- 关于asp.net 中执行<script>代码后页面布局变的不正常
- asp.net服务器端执行javascript代码
- 计算asp.net当前页执行时间代码
- 每日学习心得:CustomValidator验证控件验证用户输入的字符长度、Linq 多字段分组统计、ASP.NET后台弹出confirm对话框,然后点击确定,执行一段代码
- ASP.NET程序中与js结合常用的三十三种代码
- 【ASP.NET】解决执行<script>代码后页面布局变化问题
- asp.net 结合mysql存储过程进行分页代码