Ok so i have run into a bind with my work. I have a xml document i am trying to change. The value has to change every time a file has downloaded. So basically when file A finishes downloading version.xml has a id that i want to change from "0" to "1". Now with this i can finally set up my launcher the way i want it to be here the code that i have.
private void GetNextNodeID()
{
XmlDocument doc = new XmlDocument();
doc.Load(@"version.xml");
var x = doc.GetElementsByTagName("Product");
int Max = 0;
Max++
XmlElement newElement = doc.CreateElement("Product");
newElement.SetAttribute("id", Max.ToString());
doc.Save(@"version.xml");
}
also here is the xml document
<Table>
<Product>
<Product>0</Product>
<Product_name>Vitare</Product_name>
<Product_version>1.0.0.1</Product_version>
</Product>
</Table>
Now for some reason the code never messes with the xml file please help me figure out how to increment the value!!!!!!!!!
Thank you , Devin Magaro