I need to track the folder and its subdirectories for any file manipulations (add / remove / rename). I read about FileSystemWatcher, but I would like to track changes between each program launch or when the user clicks the Check for Changes button (FSW seems more focused on detecting runtimes). My first thought was to iterate over all the (sub) directories and the hash of each file. Then combine all the hashes (which were ordered) and the hash. When I want to check for changes, I repeat the process and check if the hashes match.
Is this an effective way to do this? Also, as soon as I detected a change, how do I know which file was added, deleted, or renamed as quickly as possible?
As a side note, I am not opposed to using scripts to do this if they are faster, as long as these scripts do not require end users to install anything, and scripts can notify my C # application of the changes.
source
share