XmlDocument xml = new XmlDocument(); xml.Load(Server.MapPath("~/etao/IncrementIndex.xml")); XmlNode item_ids = xml.GetElementsByTagName("item_ids")[0]; XmlElement newElement = xml.CreateElement("outer_id"); newElement.SetAttribute("action", "upload"); newElement.InnerText =pid; item_ids.AppendChild(newElement); XmlNodeList modified = xml.GetElementsByTagName("modified"); modified.Item(0).InnerText = DateTime.Now.ToString(); xml.Save(Server.MapPath("~/etao/IncrementIndex.xml"));
xml:
- 1.0 2011-7-4 9:42:54 官网 etao/SellerCats.xml etao/item/ - ID1000018452 //新增加的 ID1000018413