The below code:
Dim MyFiles As System.Collections.Generic.IEnumerable(Of String)
MyFiles = Directory.EnumerateFiles(MyPath, "*.txt", SearchOption.AllDirectories)
For Each MyFile As String In MyFiles
How to get the number of files in MyFiles?
Since it is enumerating the collection before the whole collection is returned, not possible right?
I'm more comfortable with DirectoryInfo.GetFiles, and my files are not more than 5000, so much difference in efficiency?