110,539
社区成员
发帖
与我相关
我的任务
分享
public static Hashtable ReadResource(string fldname,string path)
{
Hashtable hs = new Hashtable();
XmlDocument xml = new XmlDocument();
xml.Load(path);
XmlNodeList node = xml.SelectSingleNode("//Name[text()='" + fldname + "']").NextSibling.SelectNodes("Control");
foreach (XmlNode n in node)
{
hs.Add(n.Attributes["name"].Value, n.Attributes["text"].Value);
}
return hs;
}
//调用
string path = Server.MapPath("XMLFile3.xml");
Hashtable hs = ReadResource("FrmPasswordChange", path);
foreach (DictionaryEntry d in hs)
{
Response.Write(d.Key + "===" + d.Value + "<br/>");
}
/*
txtTtitle===Ttiasdfasdfa234234234234sdfasdftle~
chkEnabledStatet===k23423423423423q
txtTips===tipsssssssssasdfasd34234234ssss:
*/