예제 #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("amital", "192.168.0.1", 2776, "test", "test", "test", 0, 0, "", 0));
                    }
                    onLog(new LogEventArgs("Пожалуйста, проверьте настройки подключения в файле smsc.cfg"));
                }
                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));
            }
        }
예제 #2
0
파일: SMSC.cs 프로젝트: salexdv/SMSCenter
 public void AddSMSC(SMSC pSMSC)
 {
     lock (this)
     {
         SMSCAr.Add(pSMSC);
     }
 }//AddSMSC