问题
I have written file watcher functionality to focus on particular directory activities. I can read all events like creating ,deleting ,renaming and changing the file/folder.
But i don't know how to handle cut and paste scenario, since for "cut" results as firing delete event i and "paste" results as create event firing.
how to handle cut and paste scenario? Any advice on this.
回答1:
Here ya go! Monitor the clipboard for cut/copy/paste operations :)
回答2:
On a delete, you could store the file that was deleted, and on create, check to see if they are the same. Then you know it was a cut and paste.
来源:https://stackoverflow.com/questions/10719968/how-to-capture-cut-and-paste-action-in-file-watcher-using-c-sharp