Please don't save passwords to a file, please!
If you are using version 3.5 of the framework or later, Linq to XML makes this fairly easy.
- override OnLoad in the codebehind
- construct an xml document, like:
var Xml = new XDocument(
new XDeclaration("1.0", "utf-8", "true"),
new XElement("login",
new XElement("username", username),
new XElement("password", IWarnedYou))));
File.Write( etc.)