使用C#获取EFS加密文件的详细信息 [英] Get EFS encrypted files details using C#
问题描述
我需要检索有关计算机上加密文件的更多信息,以进行完整报告.
基本上,我可以确定文件/目录是否已加密,但是我想知道谁可以访问它们(名称和证书指纹)以及是否设置了恢复代理.
我需要与您可以在:
中找到的信息完全相同的信息
-右键单击文件,然后单击属性
-在常规"标签中,点击底部的高级..."
-加密文件后,将启用详细信息"按钮.
-单击后显示信息.
看来我必须使用Win32 API.我发现以下使我考虑的线程:
http://www.dotnetmonster.com/Uwe/Forum.aspx/dotnet-interop/2391/NullReferenceException-after-a-Marshal-StructureToPtr [
Hi,
I need to retreive some more information about encrypted files on computers to make a full report.
Basicaly, I can identify if a file/directory is encrypted but I''d like to know who can access them (name and certificate thumbprint) and if there is a recovery agent set.
I need exactly the same information you can find in :
- Right click on a file and click Properties
- In General Tab, click Advanced ... at the bottom
- When the files is encrypted, Details button is enabled.
- The information appears after clicking it.
It seems I have to use the Win32 API. I found the following thread that makes me think about it :
http://www.dotnetmonster.com/Uwe/Forum.aspx/dotnet-interop/2391/NullReferenceException-after-a-Marshal-StructureToPtr[^]
Any idea ?
Thanks a lot for your suggestions
推荐答案
它是文件系统的一部分,因此我将在System.IO
命名空间中查找此类内容.FileInfo.GetAccessControl
方法看起来很有趣.
It''s part of the file system, so I would look at theSystem.IO
namespace for that kind of stuff. TheFileInfo.GetAccessControl
method looks interesting.
这篇关于使用C#获取EFS加密文件的详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!