I have xml inside my App_Data folder. I need to change the values ββin the nodes of this xml. What I tried is
XmlDocument xDoc = new XmlDocument(); xDoc.Load(Server.MapPath("~/App_Data/conf.xml.config")); XmlNodeList aNodes = xDoc.SelectNodes("/ConfigInf"); foreach (XmlNode node in aNodes) { XmlNode child1 = node.SelectSingleNode("Node1"); XmlNode child2 = node.SelectSingleNode("Node2"); child1.InnerText = "Value1"; child2.InnerText = "Value2"; }
I need to rewrite xml with the new values, because when I try again to access the same xml, it must contain the new values. But when I turn to xml, I still get the old (initial) values ββonly when I call it Test.LoadConf(Server.MapPath("./App_Data/conf.xml.config")); . How to write XML with new values ββor in any other way, for example, create a new xml with new values? (Since I need to access this xml on only one page)
source share