创建具有密码保护的文件夹 [英] Create folder with password protection

查看:70
本文介绍了创建具有密码保护的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

如何创建一个带密码保护的文件夹?



我可以创建一个文件夹:



Hi there!
How can i create a folder with a password protection?

I can create a folder with:

Directory.CreateDirectory(path);





但是如何用密码保护文件夹?



But how can I protect the folder with a password?

推荐答案

通过以下链接可能会对你有所帮助



如何使用Microsoft Visual C#中的Active Directory服务接口以编程方式设置NTFS文件系统文件夹权限
go through below link may it will help you

How to programmatically set NTFS file system folder permissions by using Active Directory Service Interfaces in Microsoft Visual C#


受密码保护的文件夹不是Windows的功能。为了限制访问,您需要使用称为访问控制列表(ACL)的东西。有一些内置的类可以帮助解决这个问题,比如 FileSecurity [ ^ ]和 DirectorySecurity [ ^ ]但都要求您为现有用户分配安全性。它不会让某人有权打开文件夹而无需输入密码就打开文件夹。
Password protected folders are not a feature of Windows. In order to restrict access you need to use something called Access Control Lists (ACLs). There are a few built-in classes to help with this, like FileSecurity[^] and DirectorySecurity[^] but both require that you assign security to existing users. It will not keep somebody logged in who has permissions to open the folder from opening it without entering the password.


实际上Ron Beyer是对的。不过,如果你想隐藏管理员的东西,那也不行。



你可以使用(A)EFS [ ^ ]来自代码:http://msdn.microsoft.com/en-us/library/system.io .file.encrypt(v = vs.110).aspx [ ^ ]或创建加密内容(B): http://support.microsoft.com/kb/307010 [ ^ ]。

后来只适用于单个文件。添加适当的ACL可以隐藏未经授权的普通用户的文件,但管理员都无法读取内容。请注意,EFS绑定到该系统上的用户,因此您必须考虑低谷: https://support.microsoft.com / kb / 223316 [ ^ ]



但您也可以使用类似7-zip的API(C)(参见: http:// sevenzipsharp.codeplex.com/ [ ^ ])创建encypted文件夹。您甚至可以组合ziping和加密文件流本身(D)。



但只有(A)和(C)才能使授权用户通过应用程序访问内容其他人比你的。
Actually Ron Beyer is right. Still, if you want to hide something from the administrator too, than that won't work.

You can use (A) EFS[^] from code: http://msdn.microsoft.com/en-us/library/system.io.file.encrypt(v=vs.110).aspx[^] or create encrypted content (B): http://support.microsoft.com/kb/307010[^].
This later works for individual files only. Adding proper ACLs could hide files from non-authorized normal users, but neither the administrator can read the content. Be aware, that EFS is bound to the user on that system, so you have to think trough: https://support.microsoft.com/kb/223316[^]

But you can use also something like 7-zip's API (C) (see: http://sevenzipsharp.codeplex.com/[^]) to create encypted "folders". You can even combine ziping and encrypting the filestream itself (D).

But only (A) and (C) will enable the authorized users to access the content with applications others than yours.


这篇关于创建具有密码保护的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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