日期:2014-05-17 浏览次数:20682 次
void Application_Start(object sender, EventArgs e) { //在应用程序启动时运行的代码 checkTimer = new System.Timers.Timer(); inProgss = false; checkTimer.Interval = 5000; checkTimer.Elapsed += new System.Timers.ElapsedEventHandler(checkTimer_Elapsed); } private System.Timers.Timer checkTimer; private bool inProgss = false; void checkTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if (!inProgss) { inProgss = true; //执行需要的代码 inProgss = false; } }