using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
private XmlDocument xmlDoc;
//load xml fileprivatevoid LoadXml()
{
xmlDoc=new XmlDocument();
xmlDoc.Load(Server.MapPath("User.xml"));
}
//添加节点privatevoid AddElement()
{
LoadXml();
XmlNode xmldocSelect=xmlDoc.SelectSingleNode("user");
XmlElement el=xmlDoc.CreateElement("person"); //添加person节点el.SetAttribute("name","风云"); //添加person节点的属性"name"el.SetAttribute("sex","女"); //添加person节点的属性 "sex"el.SetAttribute("age","25"); //添加person节点的属性 "age"