FileSystemWatcher problem

nbrege

Active member
Joined
Jan 12, 2006
Messages
34
I have set up a FileSystemWatcher component in my program to watch a certain folder for new files. It is working fine except that it is firing 2 or 3 times whenever a new file is created in the watched folder, which is causing problems elsewhere in my program. Is there a way in which I can set the FileSystemWatcher component to fire only once for each new file that gets created? I have tried changing the .NotifyFilter property to the various options, but I still get the multiple events firing. Thanks for any help...
 
Which event(s) are being fired, and how are the files being created/placed?
 
The files are just text files that are created with notepad. How do I determine which events are being fired?
 
Are the files being saved over? Newly created? Any copying? And the best way to determine which events are being fired is to handle them. You can throw a MessageBox or something in the handler to tell you that the event was fired.
 
Back
Top