动态绑定后台数据
时间:2010-11-09 来源:浮沉
XmlTextWriter xw = new XmlTextWriter(Server.MapPath("shop.xml").ToString(),System.Text.Encoding.ASCII);
xw.Indentation = 4;
xw.Formatting = Formatting.Indented;
xw.WriteStartDocument();
xw.WriteStartElement("sitemapnode");
xw.WriteAttributeString("title", lst[0].Id.ToString());
for (int i = 0; i < lst.Count; i++)
{
xw.WriteElementString("sitenode",lst[i].Name.ToString());
}
xw.WriteEndElement();
xw.WriteEndDocument();
xw.Flush();
xw.Close();
相关阅读 更多 +