public static BPush_Config_Mod GetConfig(string path, string name) { BPush_Config_Mod info = new BPush_Config_Mod(); info.IsOpen = IsOpen(path, name); if (info.IsOpen) { BPush_Config_Mod Temp = GetValue(path, name); info.WebSite = Temp.WebSite; info.UserName = Temp.UserName; info.PassWord = Temp.PassWord; info.Android = GetValue12(path, name); info.Ios = GetValue1222(path, name); } return(info); }
private static BPush_Config_Mod GetValue(string path, string name) { BPush_Config_Mod info = new BPush_Config_Mod(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(path); XmlNode xn = xmlDoc.SelectSingleNode("configuration"); XmlNodeList XmlList = xn.ChildNodes; foreach (XmlNode xnf in XmlList) { XmlElement xe122 = (XmlElement)xnf; if (xe122.GetAttribute("Name") == name) { XmlElement xe = (XmlElement)xnf; if (xe.Name == "Config") { foreach (XmlNode t in xnf.ChildNodes) { XmlElement xe1 = (XmlElement)t; if (xe1.Name == "WebSite") { info.WebSite = xe1.InnerText; } if (xe1.Name == "UserName") { info.UserName = xe1.InnerText; } if (xe1.Name == "PassWord") { info.PassWord = xe1.InnerText; } } return(info); } } } return(info); }