FileSystemWatcher and windows 7

前端 未结 5 911
花落未央
花落未央 2020-12-30 06:42

I am writing a tool that monitors a network directory and is running off of a Windows Server 2008 machine, the OnChanged event for the FileSystemWatcher is being fired corre

5条回答
  •  隐瞒了意图╮
    2020-12-30 07:18

    Most of the times when a FileSystemWatcher event fires, I ignore the files that are being passed by the object because this list may be incomplete.

    I simply crawl through the directory that the FileSystemWatcher object is monitoring and perform a manual scan to find the files that might not be in the FileSystemWatcher buffer. It's not really elegant, but it makes sure you won't miss a file.

提交回复
热议问题