NotifyFilters.LastWrite - throws 2 events ?!

I

Iddo

Hi
I'm using the FileSystemWatcher for notification when a file was Last write.
When using the Filter : NotifyFilter.LastWrite I get 2 events.
My code looks like this:

Private FileSystemWatcher watcher;
watcher = new FileSystemWatcher();
watcher.Path = "c:\Temp";
watcher.Filter = "test.txt";
watcher.NotifyFilter = NotifyFilters.LastWrite;
watcher.changed += new System.IO.FileSystemHandler(FileChanged);
watcher.EnableRaisingEvents = true;

Please let me know how to reduce the thrown events to 1...

Thanks ahead

IL
 
C

Chris Dunaway

Are you sure you're not subscribing to the event more than once in the
code somewhere?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top