FileSystemWatcher events raising twice despite taking measures against it

前端 未结 2 1605
情歌与酒
情歌与酒 2020-12-03 19:43

I\'ve browsed quite a few threads on here and on other sites for solutions to this problem.

Here\'s my FileMonitor class:

class FileMonitor
{
    pub         


        
2条回答
  •  旧巷少年郎
    2020-12-03 20:21

    I've had the same problem and after much ado came to the conclusion that Notepad writes a file three times (!) in row. If an app really saves that much often (maybe to triangulate backups and such) there isn't much you can do.

    I also noticed you have attached to all events, you should narrow it down to the least you need and filter out those you aren't interested in with the NotifyFilters.

提交回复
热议问题