基本上-如何实现这一点。代码是千言万语吗?它的设计有缺陷吗?
TimersConfig timersConfig = ConfigurationManager.GetSection("Timers") as TimersConfig;
foreach (TimerElement t in timersConfig.Timers)
{
System.Windows.Forms.Timer timerComponent = new System.Windows.Forms.Timer();
timerComponent.Interval = t.Interval;
timerComponent.Tick += new EventHandler(timerComponent_Tick);
}
如果你所说的"让它工作"是指计时器不工作,那是因为你还没有启动它们
将其添加到循环的末尾:
timerComponent.Start();