如何在除quartz.net之外的ASP.NET中执行调度 [英] How to perform scheduling in ASP.NET other than quartz.net

查看:63
本文介绍了如何在除quartz.net之外的ASP.NET中执行调度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用quartz.net来安排任务,但它在生产中运行了两次。

我的调度程序只是向大约50人发送电子邮件,但石英总是运行两次,有时会失败大约10到15封电子邮件。



我尝试了什么:



我试过石英。 net open source并在每天早上5点安排一份工作。

解决方案

你为什么不写一个windows服务并用它作为调度程序,只需写一个程序发送邮寄并安排它。见下面的链接

使用C#创建Windows服务并在固定时间每天发送邮件 [ ^ ]

如何安排c#中的Windows服务? [ ^ ]


你需要创建包含的Windows服务定时器控制将调用一个函数。这个函数将包含你需要在一些ti之后重复执行的逻辑me。使用计时器控件的

 Elapsed 

事件。然后你可以生成exe并安装该exe文件。然后启动Windows服务。



链接:安装/卸载.NET Windows服务[C#] [ ^ ]


I have used quartz.net for scheduling the task but it runs twice in production.
my scheduler simply sends email to about 50 persons but quartz always run twice and sometimes failed about 10 to 15 emails.

What I have tried:

I have tried quartz.net open source and schedule a job at 5 am daily.

解决方案

Why don't you write a windows service and use it as scheduler, just write a program to send mail and schedule it. see below links
Create Windows Service and Send Mail Daily At Fixed Time Using C#[^]
How to schedule windows service in c#?[^]


You need to create windows service which includes timer control which will call a function .This function will contain the logic you need to execute repeatedly after some time.Make use of timer control's

Elapsed

event. and then you can generate exe and install that exe file. then start windows service.

link : Install / Uninstall .NET Windows Service [C#][^]


这篇关于如何在除quartz.net之外的ASP.NET中执行调度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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