private void GenTimer()
{var timer = new System.Timers.Timer(1000*60*10);//10 分钟
timer.AutoReset = true;//AutoReset 属性为 true 时,每隔指定工夫循环一次;如果为 false,则只执行一次。timer.Enabled = true;
timer.Elapsed += new System.Timers.ElapsedEventHandler(RefreshLoadedGsmPort);
}
private void RefreshAllGsmPort(object sender, EventArgs e)
{InitAllGsmPort();
Console.WriteLine("RefreshAllGsmPort...");
}