C#:Getting all image files in folder

Have a look at the DirectoryInfo.GetFiles overload that takes a SearchOption argument and pass SearchOption.AllDirectories to get the files including all sub-directories.

Another option is to use Directory.GetFiles which has an overload that takes a SearchOption argument as well:

return Directory.GetFiles(folderName, "*.*", SearchOption.AllDirectories)
                .ToList();

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)