Home > Web Front-end > JS Tutorial > How to use System.Timers.Timer in asp.net_javascript skills

How to use System.Timers.Timer in asp.net_javascript skills

WBOY
Release: 2016-05-16 17:40:01
Original
1010 people have browsed it

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.

Copy code The code is as follows:

void Application_Start(object sender, EventArgs e) {
MT.Enabled = true;

MT.Interval = 1000;

MT.Elapsed = new System.Timers.ElapsedEventHandler(MTimedEvent);

}

void MTimedEvent(object source, System.Timers.ElapsedEventArgs e)                                    

void StartWork()

{

//The executed code is written here

}


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template