ariez88 -4 Light Poster

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(in red color).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>");

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.