Writing XML with C#
问题 My C# is a bit rusty and I've never written XML with it before. I'm having trouble getting the XML to write to a file if I attempt to write anything other than elements. Here is the test code that I have: var guiPath = txtGuiPath.Text; MessageBox.Show("Dumping File: " + guiPath); try { var writer = new XmlTextWriter("client_settings.xml", null); writer.WriteStartDocument(); writer.WriteComment("Config generated on 01/01/01"); writer.WriteStartElement("Config"); writer.WriteStartElement(