如何使用asp.net在任务调度程序中创建一次性任务 [英] How to create one time tasks in task scheduler using asp.net

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

问题描述

我创建了一个Web应用程序,其中有一个表单用于在特定日期和时间创建事件。现在客户端希望在该日期和时间发送邮件到邮件ID。我认为唯一的解决方案是使用具有触发器一次的任务调度程序可以在特定日期和时间发送邮件,这样当我们创建每个事件时,就会创建一个任务调度程序。我已经搜索了很多并且找不到任何用于在任务中创建任务的代码调度程序使用asp.net。



请帮助!!!!!!!!!!!!

I had created a web application in which there is a form for creating an event at a specific date and time.Now the client wants to send mail at that date and time to a mail id.I think the only solution to schedule sending a mail at a specific date and time can be accomplished using task scheduler with trigger one time, so that when we create each event there creates a task scheduler.I had searched a lot and can't find any code for creating tasks in task scheduler using asp.net.

PLEASE HELP!!!!!!!!!!!!

推荐答案

您有两种选择。



1.您可以通过运行 Windows任务计划程序来完成此操作。它只是一个 Window Console 应用程序,它将在您的服务器中进行安排。在应用程序内部,写​​下您发送电子邮件的代码。



您可以选择时间(何时运行)和频率(何时再次重复)计划程序



2.参考 - 如何在ASP.NET中运行后台任务 [ ^ ]。您可以使用 Azure WebJobs 。如果您没有 Azure ,那么请转到 Scott 在其博客中提到的其他后台任务管理器
You have two options.

1. You can do this by running a Windows Task Scheduler. It is nothing but one Window or Console App, which will be scheduled in your Server. Inside the app, write you email sending code.

You can select the Time(when to run) and Frequency(when to repeat it again) for the Scheduler.

2. Refer - How to run Background Tasks in ASP.NET[^]. You can use Azure WebJobs. If you don't have Azure, then go for the other Background Task managers mentioned by Scott in his blog.


这篇关于如何使用asp.net在任务调度程序中创建一次性任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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