I want to change the values of some Elements but my code isn't working. I have this XML-File:
<?xml version="1.0" encoding="utf-8"?>
<data>
<application id="1">
<applicationName>Instagram</applicationName>
<username>test</username>
<password>123</password>
<info>test</info>
</application>
</data>
And this C# Code:
string applicationName = "Test";
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("Data.xml");
XmlNode node = xmlDoc.SelectSingleNode("/data/application[@id='1']/applicationName");
node.InnerText = applicationName;
xmlDoc.Save("Data.xml");
What is the correct code to change the applicationName
in the XML-File?