How to secure files and folders through C # .NET in FAT file system

I created a folder lock in C # .NET, which works well on the NTFS file system. But it does not work with the FAT file system. tell us which dll / class / namespace should be used to get files and Lock folders in the FAT file system via C # .NET.

sample code that works with NTFS (the code below is for unlocking a file / folder)

FileInfo info = new FileInfo(folderpath);
FileSecurity accessControl = info.GetAccessControl(AccessControlSections.All);
accessControl.RemoveAccessRule(
    new FileSystemAccessRule(
        Environment.UserName.ToString(), 
        FileSystemRights.FullControl, 
        AccessControlType.Deny));

accessControl.SetSecurityDescriptorSddlForm(
    "D:(A;;GAGRGWGXRCSDWDWORPWPCCDCLCSWLODTCR;;;WD)", 
    AccessControlSections.All);
info.SetAccessControl(accessControl);
0
source share
2 answers

. FAT , . ( , FAT, , )

+2

FAT , ACL , .

Wikipedia

0

Source: https://habr.com/ru/post/1788947/


All Articles