string FilePath = HttpContext.Current.Server.MapPath("..") + "/Fileflag.xml";
XmlDocument dom = new XmlDocument();
dom.Load(FilePath);
foreach (XmlElement FileDb in dom.DocumentElement.ChildNodes)
{
string type = FileDb.SelectSingleNode("FileName").InnerText;
string addr = FileDb.SelectSingleNode("Addr").InnerText;
string desc = FileDb.SelectSingleNode("Desc").InnerText;
int index = int.Parse(addr);
int CheckedNUM = 0;
DateTime gqDate = DateTime.Now;
try
{
CheckedNUM = int.Parse(ftmp[index].Substring(0, 1));
gqDate = DateTime.Parse(ftmp[index].Substring(ftmp[index].IndexOf('*') + 1));
}
catch { }
CheckBox ck = new CheckBox();
ck.ID = "ckn" + addr;
if (CheckedNUM == 1 || CheckedNUM == 9)
{
ck.Checked = true;
}
else
{
ck.Checked = false;
}
this.divFVF.Controls.Add(ck);
TextBox tbxName1 = new TextBox();
tbxName1.ID = "tbxName" + addr;
tbxName1.Text = gqDate.ToShortDateString();
this.divFVF.Controls.Add(tbxName1);
Label lbcap = new Label();
lbcap.Text = addr + "::" + desc;
this.divFVF.Controls.Add(lbcap);
Label lbcap1 = new Label();
lbcap1.Text = "</p>";
this.divFVF.Controls.Add(lbcap1);
}
<?xml version="1.0" encoding="utf-8" ?>
<FileDb>
<No1>
<FileName>$All Swith </FileName>
<Addr>0</Addr>
<Desc>所有栏目</Desc>
</No1>
</FileDb>