ServerFault suggested I ask here. I need a directory watcher to trigger a command line FTP client to upload some files to a server. I don't care for the idea of keeping a connection to the server all day, so I need a directory watcher. This looks perfect, and I have tried everything I know possible. But I have hit the limit of my knowledge for something that is obviously very simple. If any one is interested, would point out my mistake?
I found this useful directory watcher service through google, but I have been unable to get it to work for me. I try to avoid asking for help with low skill things like this, but I have exhausted my knowledge and I don't know any C# so I can't troubleshoot the code. The log files say the service starts, and enters running mode, and stops, but nothing happens when I move a file into the watched folder.
If you find the code interesting or useful would you try it and let me know what works?
FWIW, this is the config file I was using: (but can't get it to appear)
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="watchInformation" type="DirectoryWatcher.WatchInformation, DirectoryWatcher"/>
</configSections>
<appSettings>
<add key="maxConcurrentProcesses" value="1"/>
</appSettings>
<watchInformation>
<directoriesToWatch>
<directoryToWatch path="C:\ftp_folder">
<fileSetsToWatch>
<fileSetToWatch>
<eventsToWatch>
<eventToWatch type="All"/>
</eventsToWatch>
<programsToExecute>
<programToExecute path="cmd.exe" arguments="/C" />
</programsToExecute>
</fileSetToWatch>
</fileSetsToWatch>
</directoryToWatch>
</directoriesToWatch>
</watchInformation>
</configuration>