|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
FileSystemWatcher questionI am writing a program that watches a certain folder for incoming files &
then moves those files to another folder. Here's the problem: if I copy a group of files into the watched folder it works fine, but if I move a group of files into the watched folder it doesn't do anything, the event handler never triggers. What is the proper notify filter to use to watch for new files in a folder? I have tried both the Size & LastWrite filters but neither does what I want. Why does it work when I copy files into the folder but not when I move them? Any help would be appreciated. "nbrege" <nbr***@discussions.microsoft.com> wrote in message maybe the .Create filter (if there is one)news:08377BBC-8715-4330-AA64-D6617968E664@microsoft.com... >I am writing a program that watches a certain folder for incoming files & > then moves those files to another folder. Here's the problem: if I copy a > group of files into the watched folder it works fine, but if I move a > group > of files into the watched folder it doesn't do anything, the event handler > never triggers. What is the proper notify filter to use to watch for new > files in a folder? I have tried both the Size & LastWrite filters but > neither > does what I want. Why does it work when I copy files into the folder but > not > when I move them? Any help would be appreciated. the filewatcher got several events that you can subscribe to like .Changed ..Error .Renamed and so on. subscribe to them all and see which one triggers when you move the files into the folder. Addhandler, filesystemwatcher.Changed, AddressOf yourmethod sub yourmethod(sender, e) 'code here en sub |
|||||||||||||||||||||||