public DWWG() { XmlFileSerialize xfs = new XmlFileSerialize("DWWG.Config"); Config _config = xfs.DeSerialize <Config>(); account = _config.Account; password = _config.Password; serverUrl = _config.ServerUrl; scrId = _config.SrcID; userId = _config.UserId; balanceUrl = serverUrl + "/sms.aspx"; sendUrl = serverUrl + "/sms.aspx"; statusUrl = serverUrl + "/statusApi.aspx"; moUrl = serverUrl + "/callApi.aspx"; tmrReport = new Timer(10000); tmrReport.Elapsed += tmrReport_Elapsed; tmrMO = new Timer(10000); tmrMO.Elapsed += tmrMO_Elapsed; sends = new Dictionary <string, ExSendEventArgs>(); try { BinarySerialize <List <ExSendEventArgs> > bs = new BinarySerialize <List <ExSendEventArgs> >(); List <ExSendEventArgs> cache = bs.DeSerialize("ReportCache"); foreach (ExSendEventArgs c in cache) { sends.Add(c.SendEventArgs.SerialNumber, c); } } catch (Exception ex) { MessageTools.MessageHelper.Instance.WirteError("加载已发送队列发送错误", ex); LogClient.LogHelper.LogInfo("DWWG", "Save ReportCache Error ->", ex.Message); } }
public TPYX() { XmlFileSerialize xfs = new XmlFileSerialize("TPYX.Config"); Config _config = xfs.DeSerialize <Config>(); account = _config.Account; password = _config.Password; scrid = _config.SrcID; tmrReport = new Timer(10000); tmrMO = new Timer(10000); tmrMO.Elapsed += tmrMO_Elapsed; tmrReport.Elapsed += tmr_Elapsed; client = new TPWS.MsgSendSoapClient(); sends = new Dictionary <string, ExSendEventArgs>(); try { BinarySerialize <List <ExSendEventArgs> > bs = new BinarySerialize <List <ExSendEventArgs> >(); List <ExSendEventArgs> cache = bs.DeSerialize("ReportCache"); foreach (ExSendEventArgs c in cache) { sends.Add(c.SendEventArgs.Serial, c); } } catch (Exception ex) { Console.WriteLine(ex.Message); LogClient.LogHelper.LogInfo("TPYX", "Save ReportCache Error ->", ex.Message); } }
public JCWG() { XmlFileSerialize xfs = new XmlFileSerialize("JCWG.Config"); Config _config = xfs.DeSerialize <Config>(); string httpport = _config.HttpPort; account = _config.Account; password = _config.Password; serverUrl = _config.ServerUrl; scrId = _config.SrcID; queryBalanceUrl = serverUrl + "/msg/QueryBalance"; sendUrl = serverUrl + "/msg/HttpSendSM"; int port; if (!int.TryParse(httpport, out port)) { throw new Exception("Initialization HttpPort error."); } httpServer = new SMSHttpServer(port); httpServer.DeliverEvent += HttpServer_DeliverEvent; httpServer.ReportEvent += HttpServer_ReportEvent; httpServer.Start(); }
public SMSHttpServer(int port) : base(port) { XmlFileSerialize xfs = new XmlFileSerialize("JCWG.Config"); Config _config = xfs.DeSerialize <Config>(); reportUrl = _config.ReportURL; moUrl = _config.MOURL; }
public ZS3WG() { XmlFileSerialize xfs = new XmlFileSerialize("ZS3WG.Config"); Config _config = xfs.DeSerialize <Config>(); account = _config.Account; password = _config.Password; serverUrl = _config.ServerUrl; scrId = _config.SrcID; userId = _config.UserId; balanceUrl = serverUrl + "/sms"; sendUrl = serverUrl + "/sms"; statusUrl = serverUrl + "/sms"; moUrl = serverUrl + "/sms"; tmrReport = new Timer(10000); tmrReport.Elapsed += tmrReport_Elapsed; tmrMO = new Timer(10000); tmrMO.Elapsed += tmrMO_Elapsed; sends = new Dictionary <string, ExSendEventArgs>(); try { BinarySerialize <List <ExSendEventArgs> > bs = new BinarySerialize <List <ExSendEventArgs> >(); List <ExSendEventArgs> cache = bs.DeSerialize("ReportCache"); foreach (ExSendEventArgs c in cache) { sends.Add(c.SendEventArgs.Serial, c); } } catch (Exception ex) { Console.WriteLine(ex.Message); LogClient.LogHelper.LogInfo("ZS3WG", "Save ReportCache Error ->", ex.Message); } _cm = CacheManager <List <SMS> > .Instance; _cm.ExpireRemoveCache = true; _cm.ExpireMillisecond = 2000; _cm.CheckMillisecond = 1000; _cm.ExpireCache += _cm_ExpireCache; }
public WFLTQY() { XmlFileSerialize xfs = new XmlFileSerialize("WFLTQY.Config"); Config _config = xfs.DeSerialize <Config>(); account = _config.Account; password = _config.Password; serverUrl = _config.ServerUrl; scrId = _config.SrcID; balanceUrl = serverUrl + "/http/GetBalance"; sendUrl = serverUrl + "/http/SendSms"; statusUrl = serverUrl + "/http/GetReport"; moUrl = serverUrl + "/http/GetSms"; tmrReport = new System.Timers.Timer(35000); tmrReport.Elapsed += tmrReport_Elapsed; tmrMO = new System.Timers.Timer(35000); tmrMO.Elapsed += tmrMO_Elapsed; // sends = new Dictionary<string, ExSendEventArgs>(); sends = new Queue <ExSendEventArgs>(); try { BinarySerialize <List <ExSendEventArgs> > bs = new BinarySerialize <List <ExSendEventArgs> >(); List <ExSendEventArgs> cache = bs.DeSerialize("ReportCache"); foreach (ExSendEventArgs c in cache) { // sends.Add(c.SendEventArgs.Serial, c); sends.Enqueue(c); } } catch (Exception ex) { Console.WriteLine(ex.Message); LogClient.LogHelper.LogInfo("WFLTQY", "Save ReportCache Error ->", ex.Message); } }