How to discard getting notified with files system: e.g: thumbs.db
I have this instance of FileSystemWatcher:
FileSystemWatcher watching = new System.IO.FileSystemWatcher();
watching.Filter = "*.*";
watching.Created += new FileSystemEventHandler(OnChanged);
In a folder of ‘watching’, if an image is opened, a
thumbs.db
file is generated. the program will get stuck with the file image. Off couse, I can discard that file in OnChanged but that is not elegant. How can I discard hidden or files system in the filter?
Thanks in advance.
There seems to be no better way.
Googled for an answer and saw this answer from Microsoft MVP: http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/3082b7a3-3499-455e-bf4f-20249ea0f87e