操作过程中如何锁定文件夹 [英] HOW to lock a folder while operation is in progress
本文介绍了操作过程中如何锁定文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
目前,我正在编写一个程序,程序在该程序中处理文件夹中的文件,然后创建新文件并将其保存在另一个文件夹中.
我想知道在程序完成之前是否可以使所有人都无法访问/看不见文件夹?
我正在WinXP中的vc6中工作.我在互联网上找到了一些解决方案,但它们使用C#或VB.我正在寻找VC ++或c/sdk,C ++中的一些编程解决方案/提示
而不愿意使用某些现成的.dll等.
Hi All
Currently i am writing a application where a program processes files in a folder and creates new files and save them in another folder.
I want to know if it is possible to make folders inaccessible /invisible to everyone till the completion of the programe ??
I am working in vc6 in WinXP. i found a few solutions on internet but they are in C# or VB. i am looking for some programming solutions /hints in VC++ or c/sdk , C++
and not willing to use some ready made .dlls etc.
推荐答案
,您可以使用CREATE_FILE函数并指定没有共享权限.看一下此链接:
http://msdn.microsoft.com/en-us/library/aa363858 (v = vs.85).aspx [
you could use the CREATE_FILE function and specify no sharing rights. Take a look at this link:
http://msdn.microsoft.com/en-us/library/aa363858(v=vs.85).aspx[^]
you could also take a look at LockFile or LockFileEx function (they only work on files not folders)
Regards,
K.D
这篇关于操作过程中如何锁定文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文