VB.NEt and FileSytemWatcher ??

H

HANG LAM

Hi,
I created a Windows Service using VB.NET under LocalSystem account.
In this service, I'm using the FileSystemWatcher component to keep track of
files in a mapped directory.
I'm mapping this directory from another computer (Server-A),
but I keep getting an error saying that the FileSystemWatcher can't
recognize or can't open this directory .

Anyone has any ideas what's going on ?

Thanks,
Hang
 
L

Les Smith

Hang
I do this with a FileSystemWatcher Service that runs on
the server that it is watching, which I believe to be a
better approach. I used to do it from another computer
and watch a mapped drive, but if I lost the connection, we
lost track of file movement.

I simplified the service to write a text file on the
server that I was watching and we now almost never have
problems. I run another program that periodically renames
the file that the service is creating. I have an article
on this at
http://www.knowdotnet.com/articles/filewatcherservice.html

Regarding your original question, it sounds like either
the drive is mapped incorrectly, or you lack permissions.
I would try some debugging message boxes to print out
error messages trying various scenarios to access the
drive/path without using the filewatcher control.

I don't think it has anything to do with the control.

Hope this gives you some ideas.

Articles, books, free code, add-ins at
http://knowdotnet.com
 

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