I have program which writes to database which folders are full or empty. Now I\'m using
bool hasFiles=false;
(Directory.GetFiles(path).Length >0) ? hasFiles=
Might be worth mentioning:
but it takes almost one hour, and I can't do anything in this time. (emphasis added)
Are you doing this from a GUI app, on the main thread? If so, spit this process off using a BackgroundWorker
. At least then the app will continue to be responsive. You could also add checks for CancellationPending
in the method and cancel it if it's taking too long.
Kind of tangential to your question--just something I noticed and thought I'd comment on.