finding files in a directory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
how to get the number of files in a directory...including the files in the
subdirectories...

is there any default method of Directory class..
please help out
 
new System.IO.DirectoryInfo(@"D:\MyFolder").GetFiles("*",
System.IO.SearchOption.AllDirectories).Length
 
AVL said:
hi,
how to get the number of files in a directory...including the files in the
subdirectories...

is there any default method of Directory class..
please help out

The Directory.GetFiles method will return an array of strings for all
files found. You can specify that it will look in all subfolders.
 
Back
Top