473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 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 1950
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.