如何在 ASP.NET MVC 中调用方法例如,在一个方法中,带出一个出生的人的列表,并向他们发送祝贺信息。
There is no code provided but generally, there are several options I could think of:
BackgroundService
you can create a structure like this in the backgroundservice:
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
//Do work
await Task.Delay(timeSpan, stoppingToken);
}
}
Quartz
task scheduler, which might be overkill for your task.
https://www.quartz-scheduler.net/
A long-running timer (not recommended)
Windows Task Scheduler Task on the Server, triggering an API Method.
(Suggested by Fildor )
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.