using System.IO; using System.Xml; namespace WX.CRM.CRMServices.SMS.InterfaceModel { public class RuiXinConfig { string _Assembly = ""; string _Url = ""; string _PkgUrl = ""; string _Account = ""; string _Password = ""; public RuiXinConfig() { 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}", "RuiXinConfig")); if (xNode.Name == "RuiXinConfig") { 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 "PkgUrl": this._PkgUrl = 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; } } /// /// 提交URL /// public string Url { get { return _Url; } set { _Url = value; } } /// /// 打包提交Url /// public string PkgUrl { get { return _PkgUrl; } set { _PkgUrl = value; } } /// /// 帐号 /// public string Account { get { return _Account; } set { _Account = value; } } /// /// 密码 /// public string Password { get { return _Password; } set { _Password = value; } } } }