title: "The given path's format is not supported" when trying to create file based on current time
body: <p>Is there any way to save a file with a variable name?</p>
  
  <p>For example, I have this code but I got error in the <code>StreamWriter</code>:</p>
  
  <pre><code>string hour = DateTime.Now.ToString("HH:mm:ss");
  string date = DateTime.Now.ToShortDateString();
  string filename = "Numbers " + date + " " + hours+ ".txt";
  string path = @"C:\ShowMySms\" + filename;
  
  using (System.IO.StreamWriter file = new System.IO.StreamWriter(path, true)) {
      file.WriteLine("test");
  }
  </code></pre>
  
  <p>I also tried use </p>
  
  <pre><code>using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\ShowMySms\" + filename, true))
  </code></pre>
  
  <p>but both ways give me an error.</p>
  
  <p>Is there any way for me to export files with a different using <code>StreamWriter</code>?</p>
  
  <p>Thank you in advance!</p>
  
  <p>Edit: the error is </p>
  
  <blockquote>
    <p>The given path's format is not supported.</p>
  </blockquote>
  
  <p>I tried do </p>
  
  <pre><code>Path.Combine(path, filename);
  </code></pre>
  
  <p>and put the path in the <code>StreamWriter</code> but still getting the same error...</p>