private static void RegisterSynDateService(WindowsServiceItemCollection timerServices) { try { const double interval = 1000; var sendTimer = new WindowsTimer("SendSynDataInterval", interval); timerServices.Add(sendTimer, typeof(SysDataToDataBase)); } catch (Exception ex) { Console.Write(ex); WriterLog(ex.ToString(), "error"); } }
static void RegisterSendSmsService(WindowsServiceItemCollection timerServices) { #region 发送短信服务 try { const double interval = 1000; var sendTimer = new WindowsTimer("SendSMSInterval", interval); timerServices.Add(sendTimer, typeof(SendSmsCommand)); } catch (Exception ex) { Console.Write(ex); WriterLog(ex.ToString(), "error"); } #endregion }