472,958 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 1935
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: vijaynats | last post by:
Why isn't there a 'throws' keyword in C# like java - i would like to declare a function and say - public int addup(int a, int b) throws ArithmeticExceptio, DivideByZeroException { ... ... }
0
by: hantheman | last post by:
Hi, I have a few __hook calls to handle COM events in an event_receiver. However, the call to __hook throws an unknown exception. I can query the connection point just fine, but the hooking...
2
by: Boris Fortes | last post by:
I need to unhook event receiver as result of native C++ event. It unhooks successfully, but __raise does not return and throws access violation. Visual Studio 2003 How to reproduce: Consol...
2
by: Iddo | last post by:
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...
2
by: sling blade | last post by:
I have a form with a one panel docked to the left and a splitter control docked to the panel. I have no code, events or any other controls on the form. When I adjust the splitter (drag it to the...
1
by: Sefner | last post by:
Hey everyone. I have a program that watches a .txt log file from a chat client or a game and based on each line, triggers events. One thing I am trying to do is send the contents of a text file to...
3
by: Bartolo | last post by:
Hi, I'm trying to execute server-side trace with SqlServer 2000 on cluster. After scripting trace by Profiler I executed this script in Queryanalyzer and got error code 12. According to BOL this...
6
by: Chris Beall | last post by:
(I'm rather inexperienced with JavaScript; the failing page was cobbled together from multiple sources)... http://pages.prodigy.net/chris_beall/STL/Timeline.html If JavaScript is not present,...
2
by: £$%^ | last post by:
Hello group, I want to create an array of FileSystemWatchers. The indices of the arrays will be x(PATH) and NotifyFilters, i.e. for every PATH I will be able to run one watcher for every...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.