查找是否正在将副本复制到文件夹 [英] find if a copy is in progress to a folder
问题描述
问候;
我有一个要求,我必须创建一个监视文件夹的程序.用户将文件输入到该文件夹中,程序将不时提取并处理该文件夹.这里的问题是,如果用户在程序开始处理文件夹的过程中正在复制文件,则该程序应停止并稍后再试.例如,如果用户正在将5个文件复制到目标文件夹中,并且在程序唤醒时仅完成了复制2,则该程序不应处理这2个文件.
为此,我需要确定文件夹上的复制过程是否正在进行中.如果有人能指出我使用C#或Vb.net如何实现此目标的正确方向,我将不胜感激.
谢谢与问候
Kiran
Greetings;
I have a requirement where I have to create a program which watches a folder. The user will input files into the folder which the program will pick up from time to time and process it. The catch here is if a user is copying files during the time the program begins processing the folder, the program should stop and try again some time later. For example if user is copying 5 file into the target folder and has only finished copy 2 at the time program wakes up, the program should not process the 2 files.
In order to do this I require to find out if copy process is in progress on the folder. I would be very grateful if some one could point me to right direction in regards to how I will be able to achieve this using C# or Vb.net.
Thanks and Regards
Kiran
推荐答案
文件系统监视程序可能会帮助您..,
浏览以下链接..,
^ ]
File System watcher may helps you..,
Go through the below link..,
FileSystemWater in C#[^]
找到一种确定文件是否正被其他程序使用的方法.
find a method to determine that the file is being used by other program.
然后使用FileSystemWatcher
!
这篇关于查找是否正在将副本复制到文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!