本文介绍了获取ACL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我使用此代码在Win32Security.DLL文件夹/文件上设置writepermissions SecurityDescriptor secDesc = SecurityDescriptor.GetFileSecurity(@strFile,SECURITY_INFORMATION.DACL_SECURITY_INFORMATION) Dacl dacl = secDesc.Dacl dacl.AddAce(新的AceAccessAllowed(新的Sid(用户),AccessType.GENERIC_EXECUTE | AccessType.GENERIC_READ | AccessType.GENERIC_WRITE | AccessType.DELETE,AceFlags.CONTAINER_INHERIT_ACE | AceFlags.OBJECT_INHERIT_ACE)) secDesc.SetDacl(dacl) secDesc.SetFileSecurity(@strFile,SECURITY_INFORMATION.DACL_SECURITY_INFORMATION) 但是如何为用户获取ACL?我需要知道用户是否具有文件/文件夹中上述代码中所述的权限。I use this code to set writepermissions on a folder/file with Win32Security.DLLSecurityDescriptor secDesc = SecurityDescriptor.GetFileSecurity (@strFile, SECURITY_INFORMATION.DACL_SECURITY_INFORMATION)Dacl dacl = secDesc.Dacldacl.AddAce (new AceAccessAllowed (new Sid (user), AccessType.GENERIC_EXECUTE | AccessType.GENERIC_READ | AccessType.GENERIC_WRITE | AccessType.DELETE, AceFlags.CONTAINER_INHERIT_ACE | AceFlags.OBJECT_INHERIT_ACE))secDesc.SetDacl(dacl)secDesc.SetFileSecurity(@strFile, SECURITY_INFORMATION.DACL_SECURITY_INFORMATION)But how do I get the ACL for a user? I need to know if a user has the permissions as stated in the code above on a file/folder.推荐答案 这篇关于获取ACL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-12 17:41