Beispiel #1
0
        private void LoadConfig()
        {
            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(SMSC));

                if (!File.Exists("smsc.cfg"))
                {
                    using (TextWriter writer = new StreamWriter("smsc.cfg"))
                    {
                        serializer.Serialize(writer, new SMSC("example", "127.0.0.1", 12345, "test", "test", "test", 0, 0, "", 0));
                    }
                    onLog(new LogEventArgs("Please edit smsc.cfg and enter your data."));
                }
                using (FileStream fs = new FileStream("smsc.cfg", FileMode.Open))
                {
                    SMSC smsc = (SMSC)serializer.Deserialize(fs);
                    smppClient.AddSMSC(smsc);
                }
            }
            catch (Exception ex)
            {
                onLog(new LogEventArgs("Error on loading smsc.cfg : " + ex.Message));
            }
        }
Beispiel #2
0
 public void AddSMSC(SMSC pSMSC)
 {
     lock (this)
     {
         SMSCAr.Add(pSMSC);
     }
 }//AddSMSC