title: Counting files in a directory using .Net
body: <p>If I want to check how many files there are in a folder (where there is likely to be 10,000+ files), is there a more efficient way than...</p>
  
  <pre><code>Public Function FileCount(FolderName as String) As Integer  
  
     Dim Files() As String
  
     Files = IO.Directory.GetFiles(FolderName)
  
     Return Files.Length  
  
  End Function
  </code></pre>
  
  <p>It seems to be unweildly to be forced to load such a potentially large array. Any better suggestions?</p>