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);
source
share