The GetFiles method of the Directory class returns an array of
Strings that contain filenames, so you can just check the length
of the array to get the number of files.
Code:
Dim numberOfFiles As Integer
Dim path As String = "c:\blah\"
numberOfFiles = System.IO.Directory.GetFiles(path).Length
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.