private static System.Timers.Timer timer= new System.Timers.Timer();
private static int inTimer = 0;
private static int time = 1;
public Service1()
{
InitializeComponent();
timer.Interval = time * 60 * 1000;//默认每1分钟执行一次
timer.Enabled = true;
timer.Elapsed += new System.Timers.ElapsedEventHandler(TimedEvent);
timer.AutoReset = true;
}
private void TimedEvent(object sender, System.Timers.ElapsedEventArgs e)
{
读取表数据,
循环修改,
// GC.Collect();
//GC.WaitForPendingFinalizers();
}