I'm using a system file watcher on a Windows Form app, it should detect *.mp4 files in a folder and sub directories and add the name to a grid. I also included another file system watcher to monitor *.txt files in another folder.
It works fine for a couple files, but then no longer works.
I have increased the buffer to max, changed the notification filters but still, after 3 or 4 catches it stops. My goal is to run the app all day long, is there a way to release the buffer programmatically? Or is there another property that could help?
obs: I use try so it don't act twice, as David suggested at https://stackoverflow.com/a/2780832/8684048
try
{
fSW_Finalizados.EnableRaisingEvents = false;
FoundFile(e.FullPath);
}
finally
{
fSW_Finalizados.EnableRaisingEvents = true;
}
Thank you.