I have to do some house cleaning on a folder with millions of files. Ultimately I would like to grab the files and then see if they exist in a database or not. But I need to first grab the files without the program choking.
I tried going the route of using
var file = Directory.GetFiles(uri, "*.*").FirstOrDefault(); however this takes forever to run. Because of the number of files.
Is there a better way to grab the files that won't take so long?