XmlNode xRoot, xNode1, xNode2; XmlDocument xDoc = new XmlDocument(); XmlDocument result = new XmlDocument(); xRoot = xDoc.CreateElement("FTP_Information"); xNode1 = xDoc.CreateElement("Details"); xNode2 = xDoc.CreateElement("FTP_ID"); xNode2.InnerText = ID; xNode1.AppendChild(xNode2); xNode2 = xDoc.CreateElement("FTP_Desc"); xNode2.InnerText = desciption; xNode1.AppendChild(xNode2); xNode2 = xDoc.CreateElement("File_Suffix"); xNode2.InnerText = suffix; xNode1.AppendChild(xNode2); xNode2 = xDoc.CreateElement("File_Name"); xNode2.InnerText = filename; xNode1.AppendChild(xNode2); xNode2 = xDoc.CreateElement("File_Prefix"); xNode2.InnerText = prefix; xNode1.AppendChild(xNode2); xNode2 = xDoc.CreateElement("Host"); xNode2.InnerText = host; xNode1.AppendChild(xNode2); xNode2 = xDoc.CreateElement("Port"); xNode2.InnerText = port; xNode1.AppendChild(xNode2); xNode2 = xDoc.CreateElement("UserID"); xNode2.InnerText = enUser; xNode1.AppendChild(xNode2); xNode2 = xDoc.CreateElement("Password"); xNode2.InnerText = enPassword; xNode1.AppendChild(xNode2); xRoot.AppendChild(xNode1); if (xRoot != null) { result.LoadXml(xRoot.OuterXml); // Save the document to a file and auto-indent the output. XmlTextWriter writer = new XmlTextWriter("ftpSetup.xml", null); writer.Formatting = Formatting.Indented; result.Save(writer); MessageBox.Show("Successful"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)