In ASP. NET, combining timer and application_onstart events in global. asax can be implemented in Asp.net.ProgramPeriodically execute certain tasks (such as sending reminder emails) during running.
(If you are interested, refer to Qibao's use of timer (timer) in ASP. NET ))
However, based on this implementation method application event, how can we regularly execute Asp.netCodeDoes not support application? (For example, "... sending e-mail to selected users in the database every two hours, or regularly analyzing the data in the ASP. NET cache for application health monitoring ")
This articleArticle(Combine Web and Windows Services to run your ASP. NET code at scheduled intervals) provides an implementation method.
That is, using Windows Services as the timer, it is only responsible for regularly calling Web services that implement business logic, and "a web service can run in the same application context as the rest of your asp. NET application, it can execute in the same context that your existing code expects."
For more information, see this article ~~