如何在 MVC4 C# 中安排任务? [英] how to schedule a task in MVC4 C#?
问题描述
我想在我的网站上创建一个通知系统?(类似于堆栈溢出)
我们如何安排每 24 小时向用户发送通知的任务?
I wanna create a notification system on my website?(something like stack-overflow)
How can we schedule a task for mailing the notification for users on each 24 hours?
我们可以使用MVC4还是应该使用windows服务?
Can we use MVC4 or we should use windows service ?
我在 MVC4 应用程序中 3 个月内使用 FluentScheduler
的经验.FluentScheduler
易于配置和使用,但它不会在任何时候运行任务.有时跑有时不跑.
我认为最好的调度方式是 Windows Service
以确保在特定时间运行任务.
My Experience with using FluentScheduler
in 3 month within a MVC4 App .
FluentScheduler
is easy to config and using but it doesn't run tasks any time. Sometimes run and sometimes doesn't run.
I think the best way for scheduling is Windows Service
to ensure running a task at the specific time.
推荐答案
发现这是一个很棒的调度程序,FluentScheduler
Found this to be an awesome scheduler, FluentScheduler
用法:
// Schedule an ITask to run at an interval
Schedule<MyTask>().ToRunNow().AndEvery(2).Seconds();
这篇关于如何在 MVC4 C# 中安排任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!