Why does FileSystemWatcher fire twice

前端 未结 3 770
温柔的废话
温柔的废话 2021-01-12 06:00

why does the FileSystemWatcher fire twice? Is there an easy way to fix it? Surely if I update or edit the text file it should only fire once?

this link here http:/

3条回答
  •  终归单人心
    2021-01-12 06:41

    Check e.ChangeType. I imagine you're getting two different notifications. Perhaps LastAccess and LastModified. In which case, that's the expected behavior.

提交回复
热议问题