Service and folder polling

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

I am trying to write a service that will send out emails whenever a file
hits a folder.

I know that email services do it. Is there a way to do this without
constantly reading the folder to see when a file is put into it?

I just want to be notified by an event that something has been put into a
folder.

Thanks,

Tom
 
tshad said:
I am trying to write a service that will send out emails whenever a file
hits a folder.

I know that email services do it. Is there a way to do this without
constantly reading the folder to see when a file is put into it?

I just want to be notified by an event that something has been put into a
folder.

Thanks,

Tom

System.IO.FileSystemWatcher can be used to recieve events when a file is
created in a folder. You could then use the classes in System.Web.Mail to
send an email notification when an event is raised.

CVD
 
Cletus Van Damme said:
System.IO.FileSystemWatcher can be used to recieve events when a file is
created in a folder. You could then use the classes in System.Web.Mail to
send an email notification when an event is raised.
I just found a program on the web that does uses the Folder Watcher and it
was exactly what I was looking for and works great.

Can I still use System.Web.Mail from a normal Application or Windows
Service?

I was a little curious about that.

Thanks,

Tom
 
tshad said:
I just found a program on the web that does uses the Folder Watcher and it
was exactly what I was looking for and works great.

Can I still use System.Web.Mail from a normal Application or Windows
Service?

I was a little curious about that.

Thanks,

Tom

Yes, you sure can, just add a reference to System.Web.dll.

CVD
 
Back
Top