如何在ASP.NET中实现任务调度程序 [英] How to implement task scheduler in ASP.NET

查看:58
本文介绍了如何在ASP.NET中实现任务调度程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须实现任务调度程序,我必须每1分钟发送一次通知。

所以我该如何实现呢。我必须使用IIS服务器设置或其他任何东西,请指导我。



我尝试过:



选中IIS SERVER SETTING。然后尝试为此编写脚本。

I have to implement task scheduler where i have to send notification in every 1 min.
so how can i implement this . i have to use IIS server setting or anything else please guide me.

What I have tried:

Checked IIS SERVER SETTING . Then try to write script for this.

推荐答案

这不适合Web基础结构,因为Web站点通常是无状态的,而不是持续运行的活动。您可以使用网页设置数据库中的数据,但是您需要每分钟执行一次服务器端进程或服务 - 也许您可以使用SQL Server代理进行设置。
This isn't a good fit for a web infrastructure as web sites are generally stateless and not a constantly running activity. You can use a web page to set the data in your database but you're going to need a server side process or service to execute every minute - maybe you could set something up with the SQL Server Agent.

asp.net是一种用于此的糟糕技术,因为它是一个请求响应技术,它运行以响应http请求,而不是计时器。此外,您无法保证您的网站始终正在运行,因为如果IIS闲置,或者超出其资源限制,IIS可能会将其拆除。



无论如何,看看一个名为quartz.net的产品,它可以帮助你安排任务,但是不要因为上面提到的问题而将它用于任何关键的事情,如果关键是使用Windows服务。
asp.net is a bad technology to use for this as it is a request\response technology, it runs in response to an http request, not on a timer. Also you can't ever guarantee your site is ever running as IIS may tear it down if it has been idle, or if it is exceeding its resource limits.

Anyway, look at a product called quartz.net which will help you schedule tasks, but don't use it for anything critical due to issues mentioned above, if it is critical use a windows service instead.


这篇关于如何在ASP.NET中实现任务调度程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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