2017-03-15 2 views
1

작동하는 폴더에 사용 권한을 적용 할 수있는 코드가 있지만 폴더 권한을 '특별'으로 설정하고 필요한 경우이 "폴더 및 파일"로 적용됩니다 "이 폴더, 하위 폴더 및 파일"로 적용됩니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까?"이 폴더, 하위 폴더 및 파일"에 대한 C# AddAccessRule

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

답변

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)); 
+1

브릴리언트! 이것은 완벽하게 작동했습니다. – PigsIncorporated

관련 문제