【问题标题】:C# AddAccessRule for "This folder, subfolders and files"C# AddAccessRule 用于“此文件夹、子文件夹和文件”
【发布时间】:2017-03-15 12:51:46
【问题描述】:

我有一些代码可以将权限应用于有效的文件夹,但它将文件夹权限设置为“特殊”,并将其应用为“此文件夹和文件”,我需要将其应用为“此文件夹、子文件夹和文件”。我做错了什么?

dSecurity.AddAccessRule(new FileSystemAccessRule(@"DOMAIN\" + Account, FileSystemRights.ReadAndExecute, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, ControlType));

【问题讨论】:

    标签: c# asp.net access-rules


    【解决方案1】:

    尝试将其拆分为两条规则;

    dSecurity.AddAccessRule(new FileSystemAccessRule(@"DOMAIN\" + Account, FileSystemRights.ReadAndExecute, InheritanceFlags.ContainerInherit, PropagationFlags.InheritOnly, ControlType));
    dSecurity.AddAccessRule(new FileSystemAccessRule(@"DOMAIN\" + Account, FileSystemRights.ReadAndExecute, InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, ControlType));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-31
      • 2021-06-04
      • 1970-01-01
      • 2020-07-18
      • 2013-06-30
      相关资源
      最近更新 更多