471,357 Members | 1,103 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,357 software developers and data experts.

NotifyFilters.LastWrite - throws 2 events ?!

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
Jul 22 '05 #1
2 1876
Are you sure you're not subscribing to the event more than once in the
code somewhere?

Jul 22 '05 #2
yes i'm sure...
you can see in the code sample.
Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by vijaynats | last post: by
reply views Thread by hantheman | last post: by
2 posts views Thread by sling blade | last post: by
6 posts views Thread by Chris Beall | last post: by
2 posts views Thread by £$%^ | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.