Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        public SMSHttpServer(int port)
            : base(port)
        {
            XmlFileSerialize xfs     = new XmlFileSerialize("JCWG.Config");
            Config           _config = xfs.DeSerialize <Config>();

            reportUrl = _config.ReportURL;
            moUrl     = _config.MOURL;
        }
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
0
        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);
            }
        }