每个路径上每个扩展上的C#/WPF FileSystemWatcher [英] C#/WPF FileSystemWatcher on every extension on every path
问题描述
我需要FileSystemWatcher,它可以观察相同的特定路径和特定扩展名. 但是路径可能有数十个,数百个甚至数千个(希望不是:P),而扩展名相同.路径和ext由用户添加.
I need FileSystemWatcher, that can observing same specific paths, and specific extensions. But the paths could by dozens, hundreds or maybe thousand (hope not :P), the same with extensions. The paths and ext are added by user.
创建数百个FileSystemWatcher并不是一个好主意,不是吗?
Creating hundreds of FileSystemWatcher it's not good idea, isn't it?
那么-怎么做? 是否可以观看/观察每个设备(HDD,SD闪存,笔式驱动器等)? 会有效吗?我不这么认为.每个变化的Windows日志文件,通过防病毒程序扫描文件-确实可以使用SystemWatcher降低我的程序速度:(
So - how to do it? Is it possible to watch/observing every device (HDDs, SD flash, pendrives, etc.)? Will it be efficient? I don't think so... . Every changing Windows log file, scanning file by antyvirus program - it could realy slow down my program with SystemWatcher :(
推荐答案
首先尝试一下,然后看看是否遇到麻烦.
Well try first and then you'll see if you run into troubles.
尝试优化甚至不知道是否存在问题的东西通常都不是很有效.
Trying to optimize something where you don't even know if there is a problem is usually not very effective.
这篇关于每个路径上每个扩展上的C#/WPF FileSystemWatcher的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!