title: Given a Path, how to determine whether it is directory or a file
body: <p>I need to copy files and directories within a directory. Suppose there is only one level.</p>
  
  <p>There is a directory C:\AAAA which contains 5 other directories (sub-directories not having other children) and 7 files.</p>
  
  <p>When I call:</p>
  
  <pre><code>System.IO.Directory.GetFileSystemEntries("C:\\AAAA");
  </code></pre>
  
  <p>which returns an string array. It will contain the entries sorted in dictonary sort order. So when I call a for-each loop:</p>
  
  <pre><code>foreach(string path in System.IO.Directory.GetFileSystemEntries("C:\\AAAA"))
  {
      //how to determine path is dictonay or file??
  }
  </code></pre>
  
  <p>so from the array returned by System.IO.Directory.GetFileSystemEntries("C:\AAAA"), how to determine that given path is a path to file or it is a directory?</p>