void Application_Start(object sender, EventArgs e) {
// 在应用程序启动时运行的代码
System.Timers.Timer MT = new System.Timers.Timer();
MT.Enabled = true;
MT.Interval = 1000;
MT.Elap
sed += new System.Timers.ElapsedEventHandler(MTimedEvent);
}
void MTimedEvent(object source, System.Timers.ElapsedEventArgs e) {
//开始工作
StartWork();
}
void StartWork()
{
//执行代码在这里
}