title: c# can i create a dynamic file name with streamwriter?
body: <p>I was trying to make the program write to a file that was named with a time stamp. Basically, saving a timestamp to a string value, I wanted it to create the file based on that time stamp. For example "Flight Manifest 10/14/2010 1:38:29 AM.txt"</p>
  
  <p>Whats the right way to do this?</p>
  
  <p>I tried something like this:</p>
  
  <pre><code>string timeStamp = DateTime.Now.ToString(), filePath = string.Format("Flight Manifest {0}", timeStamp);
  MessageBox.Show(filePath);
  
  StreamWriter outputFile = new StreamWriter(filePath);
  </code></pre>