How to schedule tasks for a given time C#

Asked

Viewed 493 times

2

I need method to perform tasks every day at the same time which class should I use for this type of task?

  • 1

    You could use the https://www.hangfire.io/ or https://www.quartz-scheduler.net/ libraries to do this, they serve to configure routines in your system to be executed at certain scheduled times

  • @Randrade this question is not a duplicate of the given. This is about ASP.NET, the other is about . NET in general. The way to schedule the execution of a task is different when you use ASP.NET.

  • This may be useful. https://msdn.microsoft.com/pt-br/library/system.timers.timer.aspx

  • @Renan The question may be using different tags, but I believe the answers will be similar, if not the same.

  • @Randrade will not be, as they are two completely different environments. What works for Windows Forms and Windows services does not work for ASP.NET.

  • @Renan The three answers may be appropriate to the question. The difference is that one speaks explicitly of Windows Services, that needs to create something more, but not exclusionary. However, the other answers show forms that work for both Winforms and Asp.Net MVC, Web API and even . NET Core.

  • Does it need to be at a specific time every day (e.g., every day at 4:00 in the morning) or whatever the time, as long as it is at the same time every day (e.g., if the app started at 1:37, let it be every day the same time)? Anyway, I particularly use the Fluent Scheduler, I find it more practical than the others, besides being open source. But I believe that both situations can also be done with the others cited.

  • @Alisson Specific time

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.