Find emtpy folder

xxn5

Member
Joined
Oct 23, 2013
Messages
8
Programming Experience
1-3
how to Find emtpy foldder file and zero siz file and del thm.
in vb.net


how to find list of zero siz file in vb.net and del them.
 
There are lots of examples of recursive file searches around so I'm not going to post another one. If you use the DirectoryInfo and FileInfo classes, a FileInfo with a Length of zero indicates an empty file. You can call GetDirectories and GetFiles on a DirectoryInfo to get an array of directories and files. If both have a Length of zero then the folder is empty. Both classes have a Delete method.
 
Back
Top