Creating multiple FileSystemWatchers in same application - how?

M

Mika M

Hi!

I've made FileSystemWatcher application to copy files from one UNC-path
(\\server\directory) into another when files appears into source path. I
made it using link http://www.developerfusion.co.uk/show/3636/2/ and
it's working fine.

Now I should make more than one instances of the FileSystemWatcher class
to watch several UNC-paths, how to do this in the same application?

Now my application already saves paths to watch into xml-file, and this
xml-file is retrieved as datatable which is bound into datagrid. But my
problem is I can't figure out how to make FileSystemWatcher instance for
each of these path according DataTable path-list?
 
B

Bela Istok

You can do someting like this, foreach(row in Dastagrid)
FileSystemWatcher w = new FilesystemWatcher.....

And you construct all of the watchers you need without a trouble, I guest
that you will not have problems because having more that one FSW ;)

Regards,

Bela Istok

PD: The code it's not the final code is to give and Idea ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top