如何检查文件夹是否正在使用中 [英] how to check if the folder is in use

查看:85
本文介绍了如何检查文件夹是否正在使用中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过Windows服务上传文件,并检查源文件夹是否有任何新文件夹到达。如果文件仍在传输,如果Windows服务遇到相同的文件夹,它将再次上传。

所以我想检查我正在使用该文件夹的条件或者nt。

plz帮助我...

i am uploading a file through a windows services and checking the source folder that if any new folder are arrived.if the file is still transferring and if the windows services encounters the same folder it will upload again.
so i want to check a condition that i that folder is in use or nt.
plz help me...

推荐答案

您可以使用 FileSystemWatcher类 [ ^ ]

查看以下链接

C#:使用FileSystem Watcher监视文件或目录的应用程序 [ ^ ]

我需要使用哪个FileSystemWatcher过滤器来查找新文件 [ ^ ]
you can use FileSystemWatcher class[^]
check below links
C#: Application to Watch a File or Directory using FileSystem Watcher[^]
Which filter of FileSystemWatcher do I need to use for finding new files[^]


这篇关于如何检查文件夹是否正在使用中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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