I am tasked with creating an app to monitor a folder for files to be processed.
I was wondering if there is anything new an exciting that I can use or should I just spin up a good old windows service?
I am tasked with creating an app to monitor a folder for files to be processed.
I was wondering if there is anything new an exciting that I can use or should I just spin up a good old windows service?
Nothing much better than the good, old FileSystemWatcher
. Here is an example:
private void Watch()
{
FileSystemWatcher watcher = new FileSystemWatcher();
watcher.Path = path;
watcher.NotifyFilter = NotifyFilters.LastWrite;
watcher.Filter = "*.*";
watcher.Changed += new FileSystemEventHandler(OnChanged);
watcher.EnableRaisingEvents = true;
}
void OnChanged(object sender, FileSystemEventArgs e)