How to capture cut and paste action in file watcher using C#

喜夏-厌秋 提交于 2020-01-06 02:30:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!