开发者

How to provide security to files and folders through C#.NET in FAT File system

I have created a folder lock in C#.NET which is working good on NTFS file system But its not working on FAT file system. please tell which dll/class/namespace should i use to get Lock files and folder on FAT file system through C#.NET

sample code which is working with NTFS (below code is to unlock file/folder)

FileInfo info = new FileInfo(folderpath);
FileSecurity accessControl = info.GetAccessControl(AccessControlSections.All);
accessControl.RemoveAccessRule(
    new FileSystemAccessRule(开发者_如何学C
        Environment.UserName.ToString(), 
        FileSystemRights.FullControl, 
        AccessControlType.Deny));

accessControl.SetSecurityDescriptorSddlForm(
    "D:(A;;GAGRGWGXRCSDWDWORPWPCCDCLCSWLODTCR;;;WD)", 
    AccessControlSections.All);
info.SetAccessControl(accessControl);


You cannot. The FAT file system does not support many advanced features, such as access control lists. (Basically the only feature resembling access control in FAT is the "read only" file attribute bit, which applies to every user)


The FAT file system does not support security so you are not able to set ACLs in the way you illustrate in your question.

More details can be found at Wikipedia

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜