using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Xml; namespace Mtxfw.Utility { /// /// 配置文件读写类 By Telesa 2010.3.2 /// public class emojiconsConfig { XmlDocument xd; string Path = System.Web.HttpContext.Current.Server.MapPath("~/App_Data/emojicons.xml"); public emojiconsConfig() { xd = new XmlDocument(); xd.Load(Path); } public string getData(string name) { string output = ""; System.Xml.XmlNodeList xnl = xd.GetElementsByTagName("key"); System.Xml.XmlNodeList xnl2 = xd.GetElementsByTagName("string"); for (int i = 0; i < xnl.Count; i++) { if (xnl[i].InnerText == name) { output = xnl2[i].InnerText; } } return output; } } }