Sunday, June 30, 2013

My XML document will not save changes made to the document

you remove the location in your codes. Like below:



XmlDocument XMLdoc = new XmlDocument();
string XMLfilename = "PasswordHoldDoc.xml";
XMLdoc.Load(XMLfilename);
XmlNode root = XMLdoc.DocumentElement;
String pwdNode = root.FirstChild.InnerText;
//XmlNode pwdNode = XMLdoc.SelectSingleNode("/directory/password");
if (pwdNode != null)
{
root.FirstChild.InnerText = passwordConfirmTextbox.Text;

// Only use Save method,
XMLdoc.Save();
MessageBox.Show("done!");





If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. My sample


No comments:

Post a Comment