Listening for file change beneath a folder

Listening for file change beneath a folder

am 13.11.2007 19:19:08 von JasonBarnett

If the following question is not the appropriate newsgroup, please direct me
to the appropriate newsgroup.

I'm working on an application that must listen for files being added,
modified, or removed from a specified folder; or one of it's subdirectories.
The application will respond by collecting information about the file(s) and
updating a database. Could someone suggest a good way to listen for these
events? I'd prefer using managed code, if possible, but I'm open to any
suggestions.

RE: Listening for file change beneath a folder

am 14.11.2007 13:21:01 von ManishBafna

Hi,
FileSystemWatcher class comes in handy when we want to monitor a folder for
any changes made. Consider we are having a production server which needs to
be monitored and an email should be triggered when a unanticipated file
change is encountered. In these circumstance FileSystemWatcher can be used to
monitor files in the server.
Below links shows how to do same:
http://www.c-sharpcorner.com/UploadFile/thiagu304/FileSystem Watcher03192007133144PM/FileSystemWatcher.aspx
http://www.expresscomputeronline.com/20040531/techspace02.sh tml
http://msdn2.microsoft.com/en-us/library/system.io.notifyfil ters(VS.71).aspx
--
Hope this answers your question.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.



"Jason Barnett" wrote:

> If the following question is not the appropriate newsgroup, please direct me
> to the appropriate newsgroup.
>
> I'm working on an application that must listen for files being added,
> modified, or removed from a specified folder; or one of it's subdirectories.
> The application will respond by collecting information about the file(s) and
> updating a database. Could someone suggest a good way to listen for these
> events? I'd prefer using managed code, if possible, but I'm open to any
> suggestions.