我使用的是FileSystemWatcher
一个目录,并添加了事件处理程序,设置其EnableRaisingEvents=true;
和IncludeSubdirectories=false;
并补充NotifyFilters
。
当运行应用程序,如果我在指定的目录中创建新的文件夹有时我得到
FileNotFoundException异常:“当读取一个目录时出错”。 System.IO.FileSystemWatcher.StartRaisingEvents()System.IO.FileSystemWatcher.set_EnableRaisingEvents(布尔值)
可能是什么问题的根本原因?
什么是StartRaisingEvents()