C#: Using FileSystemWatcher to watch for changes to files

后端 未结 3 1523
醉梦人生
醉梦人生 2021-01-22 15:42

Ok, so I learnt from How to check if a open file has been updated that I should use a FileSystemWatcher to watch for changes to files. Then now, the question is if I must keep

3条回答
  •  被撕碎了的回忆
    2021-01-22 16:11

    This really is a trade-off. Many watchers will consume more resources, but if you have a watcher on a directory containing many files/sub directories (e.g. C:), this will also consume a lot of resources.

    If all the files are located in a single folder, you should just use the single watcher.

提交回复
热议问题