namespace web.control { using System; using System.Web.UI; using System.Xml; public partial class agentmenu : UserControl { protected string strmenu; protected void Page_Load(object sender, EventArgs e) { XmlDocument document = new XmlDocument(); document.Load(base.Server.MapPath("../config/agentmenu.config")); XmlNodeList list = document.SelectNodes("//menu"); XmlNodeList list2 = document.SelectNodes("//list"); int num = 0; foreach (XmlNode node in list) { num++; this.strmenu = this.strmenu + ""; this.strmenu = this.strmenu + ""; object strmenu = this.strmenu; this.strmenu = string.Concat(new object[] { strmenu, "" }); strmenu = this.strmenu; this.strmenu = string.Concat(new object[] { strmenu, "
 " }); strmenu = this.strmenu; this.strmenu = string.Concat(new object[] { strmenu, "", node.SelectSingleNode("@text").Value, "
" }); this.strmenu = this.strmenu + ""; foreach (XmlNode node2 in list2) { if ((node2.SelectSingleNode("@type").Value == node.SelectSingleNode("@type").Value) && (node2.SelectSingleNode("@disable").Value == "false")) { string str = this.strmenu; this.strmenu = str + ""; } } this.strmenu = this.strmenu + "
" + node2.SelectSingleNode("@text").Value + "
"; } } } }