且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

FileNotFoundException异常在FileSystemWatcher的

更新时间:2023-11-19 20:46:04

这是典型的因为 FileSystemWatcher的可能是不可靠的。该文件夹可能不是完全当你的事件存在。您可能需要重试足够的停顿,做各种 Directory.Exists()在实际执行IO操作检查。

This is typically because the FileSystemWatcher can be unreliable. The folder may not "fully" exist when you get the events. You may need to retry with sufficient pauses and do various Directory.Exists() checks before actually performing IO operations.