C#: Using FileSystemWatcher to watch for changes to files
问题 Ok, so I learnt from How to check if a open file has been updated that I should use a FileSystemWatcher to watch for changes to files. Then now, the question is if I must keep track of many files, do I create 1 watcher for each file? Also, I must somehow dispose of the watcher once the file is closed. Is having a Dictionary<string, FileSystemWatcher> storing the filepath and the FileSystemWatcher the way to go? as I open more files, I add more watcher and as I close, dispose of the watchers