这是我的代码:
_instrumentsFolderWatcher.Changed += _instrumentsFolderWatcher_Changed;
_instrumentsFolderWatcher.Created += _instrumentsFolderWatcher_Created;
_instrumentsFolderWatcher.Deleted += _instrumentsFolderWatcher_Deleted;
_instrumentsFolderWatcher
的实例在哪里FileSystemWatcher
。问题是当我将文件粘贴到正在监视的文件夹中时,创建和更改的事件都会被触发。为什么会触发 changed 事件?此外,changed 事件是用ChangeType
of Changed 触发的。我该如何解决这个问题?
Edit:
为什么更改文件名时未触发 Changed 事件?