<Model name="Test.cre" version="v2.0" unit="m" count="0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(@"C:\Users\KK\Desktop\Sample.xml"); XmlElement node1 = xmlDoc.SelectSingleNode("/root") as XmlElement; if (node1 != null) { node1.SetAttribute("count", nodeCount.ToString()); // if you want an attribute } xmlDoc.Save(@"C:\Users\KK\Desktop\Sample.xml");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)