监视线程对文件的访问 [英] monitor file access by threads
本文介绍了监视线程对文件的访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我正在使用C#.
有一个选项可以实时监视线程(单线程或多线程)的文件访问吗?并且当线程访问特定文件时,我想触发事件.
我找到了观察目录或文件更改的方法,但就我而言,文件不会更改
非常感谢.
Hi
Im using C#.
There is an option to monitor file access by thread (single or multi) in real time? and when thread access to the specific file i would like to fire event.
I''ve found ways to watch directories or files change, but in my case the file is not gonna change
Thanks a lot.
推荐答案
如果使用的是WinForms,则可以使用FileSystemWatcher对象来监视文件或文件夹.
问候
Hi,
If you are using WinForms you can use FileSystemWatcher object for watching a file or folder.
Regards
这篇关于监视线程对文件的访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文