December 2018
Beginner to intermediate
668 pages
15h 30m
English
Modify the WorkWithXml method, as shown highlighted in the following code:
static void WorkWithXml(){ FileStream xmlFileStream = null; XmlWriter xml = null; try { // define a file to write to string xmlFile = Combine(CurrentDirectory, "streams.xml"); // create a file stream xmlFileStream = File.Create(xmlFile); // wrap the file stream in an XML writer helper // and automatically indent nested elements xml = XmlWriter.Create(xmlFileStream, new XmlWriterSettings { Indent = true }); // write the XML declaration xml.WriteStartDocument(); // write a root element xml.WriteStartElement("callsigns"); // enumerate the strings writing each one to the stream foreach (string item in callsigns) { xml.WriteElementString("callsign", ...Read now
Unlock full access