Trigger process when a file arrives

J

JohnSouth

Hi

I've a requirement to run a database update process whenever an XML
file is copied into a particular directory.

I could create a program to run as a Windows Service that keeps looking
into the directory, but that seems rather inefficient. Is there a
better way of triggering a process when a file arrives?

I'd appreciate any suggestions.

John South
www.WhereCanweGo.com
Pangbourne UIK
 
G

Guest

What kind of performance do u need and why recomended FileSystemWatcher isn't
suitable for you?
I've a requirement to run a database update process whenever an XML
file is copied into a particular directory.
I could create a program to run as a Windows Service that keeps looking
into the directory, but that seems rather inefficient. Is there a
better way of triggering a process when a file arrives?

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
N

Nicholas Paldino [.NET/C# MVP]

John,

As others have pointed out, you should use the FileSystemWatcher class.
Running a service is not inefficient, really. If anything, you can run the
service and then have your FileSystemWatcher instance wait for events from
the file system.

Also, you might want to check out BizTalk, as it has an adapter for
watching a directory for files.

Hope this helps.
 

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