string path = @"C:\Users\Administrator\Desktop\無人智能便利店\install\收銀端\XMLRFI.xml"; XmlDocument xmlDoc = new XmlDocument();//新建XML文件 xmlDoc.Load(path);//加 ...
string path = @"C:\Users\Administrator\Desktop\無人智能便利店\install\收銀端\XMLRFI.xml";
XmlDocument xmlDoc = new XmlDocument();//新建XML文件
xmlDoc.Load(path);//載入XML文件
XmlNode xm = xmlDoc.SelectSingleNode("RFI");
XmlElement xelKey = xmlDoc.CreateElement("RFIID");
XmlAttribute xelType = xmlDoc.CreateAttribute("Type");
xelType.InnerText = "data";
xelKey.SetAttributeNode(xelType);
XmlElement xelAuthor = xmlDoc.CreateElement("author");
xelKey.InnerText = "dfdsa";
xm.AppendChild(xelKey);
xmlDoc.Save(path);