Editing with XPathNavigator

  • Thread starter Thread starter jon cosby
  • Start date Start date
J

jon cosby

Not sure why this doesn't work. The node values are unchanged. Is there
something that needs to be done to accept the changes?


sXmlPath = Application.StartupPath.ToString() +
\\settings.xml";
XmlDocument xmlConfig = new XmlDocument();

xmlConfig.Load(sXmlPath);
XPathNavigator navigator = xmlConfig.CreateNavigator();

navigator.MoveToChild("timer", "");
navigator.MoveToChild("config", "");
navigator.MoveToChild("systrayenabled", "");
navigator.SetValue("true");




<timer>
<config user="default">
<systrayenabled>false</systrayenabled>
<systraytimer>1</systraytimer>
<logevents>false</logevents>
</config>
</timer>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top