예제 #1
0
 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");
     }
 }
예제 #2
0
 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
 }