
Polling a directory/folder thru Windows SERVICE
Start a new Windows Service project and drop in a FileSystemWatcher
component from the Components group of the ToolBox. The FileSystemWatcher
has a Created method you can override to respond to the new files when they
arrive. You have info like e.FullPath and e.FileName that gets passed to
the created event. You can tweak the FileSystemWatcher to tell it the
folder you want to watch and the different things you want to watch for.
You can also specify whether or not to watch sub-folders.
You also need to do a couple other things to get it installed. Let me know
if you need help on that also.
--
Earl Damron, MCSD, MVP (Visual Basic)
Quote:
> I need to write an Windows SERVICE, which should poll a physical folder
say
> "C:\Newfiles", Based on some conditions & logic some text files will be
> copied to this folder.
> the Service needs to pick this file and perform some operations on that
file
> and post this file to an ASP page, and delete the file form "C:\Newfiles"
> Can you suggest me how an NT service could POLL a directory(physical
folder)
> Service to be written in C# or VB.net
> regards
> PURUSHOTHAMA.R