title: C#. Writing settings to XML file
body: <p>I have some names of files. I am creating a XML file to store them. When application runs second time it should recognize those file names. Here is my code:</p>
  
  <pre><code>XmlWriter writer = XmlWriter.Create("settings.xml");
  writer.WriteStartElement("DialogCreater");
  writer.WriteElementString("conditionsFile", conditionsFile);
  writer.WriteEndElement();
  writer.Close();
  </code></pre>
  
  <p>But when I use those file names like this: </p>
  
  <pre><code>string[] lines = File.ReadAllLines(charactersFile);
  </code></pre>
  
  <p>It gives me an error.</p>
  
  <blockquote>
    <p>System.NotSupportedException</p>
  </blockquote>
  
  <p>Here how I read them from XML file:</p>
  
  <pre><code>XmlDocument doc = new XmlDocument();
  doc.Load("settings.xml");
  XmlNodeList node = doc.GetElementsByTagName("files");
  foreach (XmlNode n in node[0].ChildNodes)
  {
      if (n.Name == "conditionsFile") conditionsFile = n.InnerText;
  }
  </code></pre>