Pass UNC path with username and password to FileSystemWatcher

shuandra1

Newcomer
Joined
Dec 1, 2004
Messages
1
Hi,

I'm trying to use FileSystemWatcher to monitor multiple remote drives activities. I'm going to do this by creating multiple instances of the FileSystemWatcher and pass each drive path to them. Currently I'm successful in doing that but I have to actually map each drive to a drive letter and pass it to the FileSystemWatcher. I don't want to map each drive that I'm monitoring. Does anybody know how to pass a UNC path to the FileSystemWatcher? The network drive I'm trying to connect to requires username and password. Thanks for the help
 
I believe that can't be donne...

What you can do is to give access rights to the "watcher" computer to access that remote drive. This way the SO won't ask you for any pass.

If this is no way possible... you can implement a more complex aproach.
Install a watcher, as a windows service, in each computer that have drives needed to be watched. Then, on a Server, or any other computer that can act like that, install a Watcher Server... a Windows Service/Web Service that receaves the events catched by the watchers and stores them into a database or raises other event you may want...

Using Windows Services on the client machines will enshure that if the machine is powered on, the watcher is working, even if the computer isn't logged on...

If, on the Server, you use a Web Service, the connection between the clients and the server is very simple. If the Server can't host a Web Service, then the Windows Service must connect to the clients thru remoting...

Alex :p
 
Back
Top