- How do you open an XML file and append data to it?
- XDocument usersDoc = XDocument.Load(@"Users.xml");
- XElement userInfo =
- new XElement("Users",
- new XElement("User",
- new XElement("ScreenName", ScreenNameTB.Text),
- new XElement("Key", KeyTB.Text),
- new XElement("UserID", UserIdTB.Text)));
- usersDoc.Add(userInfo);
- usersDoc.Save(@"Users.xml");