title: Piping output to a text file in C#
body: <p>I have a method here, although I would like to pipe the output from it to a file e.g. output.txt, how could I do this in this context?</p>
  
  <pre><code>  foreach (string tmpLine in File.ReadAllLines(@"c:\filename.txt"))
    {
      if (File.Exists(tmpLine))
      {
        //output
      }
    }
  </code></pre>