title: When is file.close() necessary?
body: <p>I was wondering if it necessary to call <code>Close()</code> in the following situation (if not necessary, why?)</p>
  
  <pre><code>using (var file = System.IO.File.OpenText(myFilePath))
  {
  ...
  }
  </code></pre>
  
  <p>I presume it is necessary in the following situation</p>
  
  <pre><code>StreamWriter file2 = new System.IO.StreamWriter(myFilePath);
  newFileContents.ForEach(file2.WriteLine);
  file2.Close();
  </code></pre>
  
  <p>Is it correct?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p><em>I thought my question is close() - specific, might have been the difference between reading and writing....</em></p>