调度的Web应用程序的ASP.NET MVC [英] Scheduler for Web application ASP.NET MVC

查看:184
本文介绍了调度的Web应用程序的ASP.NET MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了由ASP.NET MVC web应用程序,可以帮助用户获得的RSS新闻。当然,它完美的作品。不过,我想扩大该网站会自动在上午6时每天发送给热点新闻,以用户的电子邮件,比如函数。

I've built a website application by ASP.NET MVC that helps user get RSS news. Of course, it works perfectly. However, I want to expand the function that the website will automatic send hot news to user's email at 6.00 am daily, for example.

我发现互联网上的解决方案,但我还是在Windows中使用Quartz.NET,Windows服务,并计划之中混淆。

I've found solutions on internet but I still confused among using Quartz.NET, Windows Service, and Schedule in windows.

请告诉我,我应该在哪里开始!

Please tell me where I should begin !

太感谢了!

推荐答案

你需要创建一个Windows服务第一:的 http://msdn.microsoft.com/en-us/library/zt39148a.aspx

First of all you will need to create a windows service: http://msdn.microsoft.com/en-us/library/zt39148a.aspx

Quartz.NET这里有一个有用的教程: http://quartznet.sourceforge.net/tutorial /lesson_1.html

Quartz.NET has a useful tutorial here: http://quartznet.sourceforge.net/tutorial/lesson_1.html

我会做的是初始化在的OnStart()覆盖您的调度,并最终在调用OnStop()

What I would do would be to initialize your scheduler in the OnStart() override and eventually stop it in the OnStop().

基本上,你可以通过创建 IJob 接口的实现定义使用触发类和作业触发器,然后使用调度来触发附加的工作。每次触发火灾,在执行作业的方法运行。

Basically you can define triggers using the Trigger class and Jobs by creating an implementation of the IJob interface, then use the scheduler to attach triggers to jobs. Everytime a trigger fires, the Execute method of the Job is run.

在这里把整个的解释是太长,但下面的教程应该得到你,你想在几分钟之内。祝你好运!

Putting the entire explanation here would be way too long, but following the tutorials should get you where you want to be in matter of minutes. Good luck!

的另一端,有一个比写一窗口服务更简单的解决方案。只要写一个控制台应用程序,然后通过任务计划程序接口(控制面板 - >在Win 7管理工具),创建在您希望的时间运行你的应用程序的任务。对于需要每天一次这可能是运行一个更好的解决方案,而不是死死的服务7×24小时一个简单的任务。

Of the other end, there is a much simpler solution than writing a windows service. Just write a console app and then, through the Task Scheduler interface (Control Panel -> Administrative Tools in Win 7), create a task that runs your app at the time you want. For a simple task that needs to run once a day this is probably a better solution rather than keeping a service up 24/7.

这篇关于调度的Web应用程序的ASP.NET MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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