每个路径上每个扩展上的C#/WPF FileSystemWatcher [英] C#/WPF FileSystemWatcher on every extension on every path

查看:87
本文介绍了每个路径上每个扩展上的C#/WPF FileSystemWatcher的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆