I recently completed a project at work that included the requirement to monitor data files on 30 or more different Windows NT4 machines for changes. Naturally I thought of using the FileSystemWatcher class in the System.IO namespace. As anyone who has used the FileSystemWatcher has come to realize, it can be unreliable. Specifically, if one of the NT4 machines were rebooted, the watcher would “lose” its ability to capture the file modification events I needed. What was my solution? Well, it’s a bit of a hack. Actually, it’s a really big hack. I used the Timer class in the System.Threading namespace to restart the watchers at a specified interval and to check for changes to the files that I might have missed. The files don’t change very often, so the solution has worked so far. I also can’t install anything on the NT4 machines, so this is what I was forced to do. Come on. I’m not the only one to hack something together like this. Am I?





March 24th, 2008 at 2:09 pm
hey from the psp