public void Save() { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(WOTHelper.GetUserFile()); XmlElement root = xmlDoc.DocumentElement; XmlNode oldPlayers = root.SelectSingleNode(@"FTPDetails"); root.RemoveChild(oldPlayers); XmlElement players = xmlDoc.CreateElement("FTPDetails"); root.AppendChild(players); XmlElement playerNode; playerNode = xmlDoc.CreateElement("FTP"); playerNode.SetAttribute("FTPHost", Host); playerNode.SetAttribute("FTPUserID", UserID); playerNode.SetAttribute("FTPUserPWD", WOTHelper.Encrypt(UserPWD)); playerNode.SetAttribute("ShareFiles", AllowFTP == true ? "Yes" : "No"); players.AppendChild(playerNode); xmlDoc.Save(WOTHelper.GetUserFile()); }