FileAttributes.Encrypted如何在C#中工作? [英] How FileAttributes.Encrypted work in C#?

查看:107
本文介绍了FileAttributes.Encrypted如何在C#中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在google上找不到任何示例...谁能显示它的工作原理?而当文件夹和文件将被加密时,如何解密呢?

I didn't find any example on google... Can anyone show how it works? And when folders and files will be encrypted how to decrypt them?

链接: 文件属性枚举

推荐答案

FileAttributes.Encrypted标志告诉您文件或文件夹是否已被NTFS文件系统加密.通过右键单击文件,选择属性",然后单击高级"按钮,用户可以使用此选项.有一个选项加密内容以保护数据",这是FileAttributes.Encrypted标志所对应的.

The FileAttributes.Encrypted flag tells you whether a file or folder has been encrypted by the NTFS file system. This option is available to users by right-clicking a file, selecting Properties, then clicking the Advanced button. There is an option "Encrypt contents to secure data" which is what the FileAttributes.Encrypted flag corresponds to.

您可以使用File.Encrypt/File.Decrypt方法来加密或解密文件或文件夹.请注意,您只能解密当前用户加密的内容.

You can use the File.Encrypt / File.Decrypt methods to encrypt or decrypt a file or folder. Note that you can only decrypt something that was encrypted by the current user.

您可以使用 查看全文

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