如何在Web应用程序中使用asp.net&c#.net将元素添加到xml文件
Here's an example of adding a new element to the root node:
XDocument doc = XDocument.Load("test.xml");
doc.Root.Add(new XElement("someNode", "some node value"));
doc.Save("test.xml");
Load the document using XmlDocument class and then modify it as needed. Reference documentation and examples here .
您可以使用XmlDocument.CreateElement方法创建它,然后附加它
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.