目录修改监控 [英] Directory Modification Monitoring
问题描述
我想避免检查每个个人文件进行修改,但我不知道我是否可以完全信任文件访问时间。
最近使用哪种方法获取最近修改的文件是什么一个目录?
只有当用户询问它时,才会检查修改,它不会是一个不断运行的服务。
嗯...有趣的问题。最初我会指出你在 FileSystemWatcher 课程。但是,如果要使其正常工作,则根据用户请求,您可能需要首先存储目录信息,然后在每次用户请求时进行比较。我可能会和FileSystemWatcher一起去,只是存储你的结果。
I'm building a C# application that will monitor a specified directory for changes and additions and storing the information in a database.
I would like to avoid checking each individual file for modifications, but I'm not sure if I can completely trust the file access time.
What would be the best method to use for getting recently modified files in a directory?
It would check for modifications only when the user asks it to, it will not be a constantly running service.
Hmm... interesting question. Initially I'd point you at the FileSystemWatcher class. If you are going to have it work, however, on user request, then it would seem you might need to store off the directory info initially and then compare each time the user requests. I'd probably go with a FileSystemWatcher and just store off your results anyhow.
这篇关于目录修改监控的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!