using System.IO; using System.Xml; namespace WX.CRM.CRMServices.SMS.InterfaceModel { public class Sms360Config { string _Assembly = ""; string _url = ""; string _userid = ""; string _account = ""; string _password = ""; public Sms360Config() { string filename = System.AppDomain.CurrentDomain.BaseDirectory + "XML\\SmsAccountConfig.xml"; try { if (File.Exists(filename)) { XmlDocument xDoc = new XmlDocument(); xDoc.Load(filename); XmlNode xNode; xNode = xDoc.SelectSingleNode(string.Format("//root//{0}", "Sms360Config")); if (xNode.Name == "Sms360Config") { XmlNodeList node = xNode.ChildNodes; foreach (XmlNode cn in node) { XmlElement temp = (XmlElement)cn; switch (temp.GetAttribute("key")) { case "Assembly": this._Assembly = temp.GetAttribute("value"); break; case "url": this._url = temp.GetAttribute("value"); break; case "userid": this._userid = temp.GetAttribute("value"); break; case "account": this._account = temp.GetAttribute("value"); break; case "password": this._password = temp.GetAttribute("value"); break; } } } } } catch { throw; } } public string Assembly { get { return _Assembly; } set { _Assembly = value; } } public string url { get { return _url; } set { _url = value; } } public string userid { get { return _userid; } set { _userid = value; } } public string account { get { return _account; } set { _account = value; } } public string password { get { return _password; } set { _password = value; } } } }