Is there any direct function to get number of folder/Files in a Folder?
I want the "contains" informations in the folder properties..
Printable View
Is there any direct function to get number of folder/Files in a Folder?
I want the "contains" informations in the folder properties..
GetFiles(path).length is the one..
but i need inner files, now am doing search recursively..
i hope this is the way.,..Code:Dim oTemp As System.IO.DirectoryInfo
oTemp = New System.IO.DirectoryInfo("C:\Program files")
Dim iFileVal As Integer = oTemp.GetFiles("*.*", IO.SearchOption.AllDirectories).Length
Dim iFolderVal As Integer = oTemp.GetDirectories("*.*", IO.SearchOption.AllDirectories).Length
That's exactly the right way.