Groups | Blog | Home
all groups > dotnet framework > september 2007 >

dotnet framework : FileSystemWatcher moved files


wpcmame
9/27/2007 12:12:02 PM
How do I detect if a file is copied or moved into a folder?

I have a watcher set on the folder with NotifyFilters.LastWrite
and a delegate on the Changed event.

It works if I save a file in the folder but not if I copy, move or paste it
there.
mash4077
9/28/2007 11:58:06 PM
Perhaps the "renamed" event will let you know when the entire path of a file
has changed? Try the code
http://www.geekpedia.com/tutorial173_File-monitoring-using-FileSystemWatcher.html
and see if a FileSystemWatcher event fires when you move a file.

[quoted text, click to view]
AddThis Social Bookmark Button