C# FileSystemWatcher, How to know file copied completely into the watch folder

后端 未结 7 1213
予麋鹿
予麋鹿 2020-12-06 20:14

I am developing a .net application, where I am using FileSystemWatcher class and attached its Created event on a folder. I have to do action on this event (i.e. copy file to

7条回答
  •  猫巷女王i
    2020-12-06 20:49

    I subscribe to the Changed- and Renamed-event and try to rename the file on every Changed-event catching the IOExceptions. If the rename succeeds, the copy has finished and the Rename-event is fired only once.

提交回复
热议问题