Home > Article > Web Front-end > How to use System.Timers.Timer in asp.net_javascript skills
We often add some regularly executed tasks to the website, such as generating static pages, sending emails, etc.
This can be achieved by setting this in Global.asax.
void Application_Start(object sender, EventArgs e) {
MT.Enabled = true;
MT.Elapsed = new System.Timers.ElapsedEventHandler(MTimedEvent);
}
void MTimedEvent(object source, System.Timers.ElapsedEventArgs e)
void StartWork(){
//The executed code is written here}