Exemple #1
0
 void tmrMO_Elapsed(object sender, ElapsedEventArgs e)
 {
     try
     {
         var list = Gateway.GetMO();
         if (list == null || list.Count == 0)
         {
             return;
         }
         if (DeliverEvent != null)
         {
             foreach (var mo in list)
             {
                 DeliverEventArgs de = new DeliverEventArgs(mo);
                 DeliverEvent(this, de);
                 string tr = JsonConvert.SerializeObject(de);
                 LogClient.LogHelper.LogInfo(Gateway.Config.GatewayName, "MO ->", tr);
             }
         }
         MessageHelper.Instance.WirteTest("上行短信:" + JsonConvert.SerializeObject(list));
     }
     catch (Exception ex)
     {
         MessageHelper.Instance.WirteError("获取上行短信发生错误", ex);
         LogClient.LogHelper.LogInfo(Gateway.Config.GatewayName, "MO Error ->", ex.Message);
     }
 }
Exemple #2
0
 void tmrMO_Elapsed(object sender, ElapsedEventArgs e)
 {
     try
     {
         var list = Gateway.GetMO();
         if (DeliverEvent != null)
         {
             foreach (var mo in list)
             {
                 DeliverEventArgs de = new DeliverEventArgs(mo);
                 DeliverEvent(this, de);
                 string tr = JsonConvert.SerializeObject(de);
                 LogClient.LogHelper.LogInfo(Gateway.Config.GatewayName, "MO ->", tr);
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         LogClient.LogHelper.LogInfo(Gateway.Config.GatewayName, "MO Error ->", ex.Message);
     }
 }