I have an app that displays specific folder file content in Window Forms and all this works fine. Problem is when I need to scan folder content again (it is read every 10 seconds), then I have "Not Responding" message if there is a lot of files to read. What would be the best way to scan files, as a Thread or BackgroundWorker (which I am using at the moment)? I don't want to have my app stucked at "not responing" message screen. Please help. Thanks!
Jump to Post
One solution would be to use FileSystemWatcher class which would raise an event when the folder content has changed. After that you would scan the files.
BackgroundWorker should be fine for scanning the folder. I didn't test this idea but you could raise ProgressChanged event from your BackgroundWorker thread and …
All 2 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.