tags:

views:

195

answers:

1

Is there a library method somewhere for figuring out whether a file has been encrypted with EFS? I see the Encrypt() and Decrypt() methods on FileInfo, but am looking for a way to query a file's state.

+3  A: 

Use GetFileAttributes(), and check for FILE_ATTRIBUTE_ENCRYPTED.

bdonlan
I was looking for a .net answer, but it turns out that it is similar to your suggestion: use FileInfo.Attributes and check for FileAttributes.Encrypted
Matt
Ah, sorry, missed your C# tag. Good to hear you found an answer though :)
bdonlan