ariez

ariez

  • NA
  • 34
  • 0

Editing in XML

Jun 14 2010 6:34 AM

i want to give administrator of my website the privilege to change his password tht is stored in xml.the administrator types the new password in "NewPass.Text" and then retype the password in "ConfirmNewPass.Text". We have successfully compared the condition in the "IF" statement.The problem is inserting the password into xml(underlined).Please correct me how to insert the password into xml.
here is the piece of code.

        string strFilePath = "F:\\Project\\XMLFile.xml"; 
        XmlTextWriter write = new XmlTextWriter(strFilePath,System.Text.Encoding.UTF8);
        XmlTextReader xr = new XmlTextReader(strFilePath);
        XmlDocument adm = new XmlDocument();
        adm.Load(xr);
        XmlNode nod = adm.FirstChild.NextSibling.FirstChild.FirstChild.NextSibling;
        string a = nod.InnerText;
        if (NewPass.Text == ConfirmNewPass.Text)

           write.WriteElementString(nod.InnerText, NewPass.Text); 
Response.Write("<script>alert('Password Changed Successfully')</script>");
       

Answers (5)