【发布时间】:2010-10-20 10:30:59
【问题描述】:
我在目录上使用FileSystemWatcher 并添加了它的事件处理程序,设置了它的EnableRaisingEvents=true; 和IncludeSubdirectories=false; 并添加了NotifyFilters。
在运行应用程序时,如果我有时会在指定目录中创建新文件夹
FileNotFoundException:“读取目录时出错”。 System.IO.FileSystemWatcher.StartRaisingEvents() System.IO.FileSystemWatcher.set_EnableRaisingEvents(布尔值)
问题的根本原因是什么?
StartRaisingEvents() 是什么?
【问题讨论】:
-
你能发布实际代码吗?我猜你正在错误地构建新的文件夹路径。
-
我正在使用资源管理器创建新文件夹> 创建新文件夹
标签: c# .net file exception file-watcher