title: Type and identifier are both required in a foreach statement ERROR in csharp
body: <p>I am converting VB.net to C# for this code:</p>
  
  <pre><code>Dim files() As String
  files = Directory.GetFiles("E:\\text", "*.txt") 
  Dim filename As String
  Dim file As String
  For Each file In files
  filename = Path.GetFileName(file)
  </code></pre>
  
  <p>I tried this in C# but got the error</p>
  
  <blockquote>
    <p>Type and identifier are both required in a foreach statement ERROR in csharp</p>
  </blockquote>
  
  <pre><code>string[] files;
  files = Directory.GetFiles("E:\\text", "*.txt");
  string[] filenameMove;
  string filename;
  string file;
  
  foreach (file  in files)
    filename = Path.GetFileName(file);
  </code></pre>