[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

FileSystemWatcher service

Eyal

1/14/2003 2:15:00 AM

Hello all..

I have a FileSystemWatcher service that looks for any
changed / created files.. I then record all events to an
xml file for further use..

the problem I'm having is this:

1. when a new file is created (drag n drop) to the 'root
folder' (path of FileSystemWatcher), two events are
recorded .. one for 'Created' one for 'Changed'. ...

is there away around this? .. can i only raise an event
when a true 'Created' - as in "New Document" - is
created? ..


1 Answer

(Ping Zheng)

1/15/2003 9:33:00 AM

0

Hi,

Two events are reasonable. How about getting the file name and the event
time, and analyzing it by yourself? The file name is included in the event
arguments, and the event time can be got from System.TimeSpan. However,
additional test should be done because the file operation is a little
complex.

This posting is provided "AS IS" with no warranties, and confers no rights.

George Zheng [MSFT]