System.IO.DirectoryInfo.GetAccessControl Method

Gets a System.Security.AccessControl.DirectorySecurity object that encapsulates the access control list (ACL) entries for the directory described by the current System.IO.DirectoryInfo object.

Syntax

public System.Security.AccessControl.DirectorySecurity GetAccessControl ()

Returns

A System.Security.AccessControl.DirectorySecurity object that encapsulates the access control rules for the directory.

Remarks

Calling this method overload is equivalent to calling the Directory.GetAccessControl(string, System.Security.AccessControl.AccessControlSections) method overload and specifying the access control sections System.Security.AccessControl.AccessControlSections.Access | System.Security.AccessControl.AccessControlSections.Owner | System.Security.AccessControl.AccessControlSections.Group (System.Security.AccessControl.AccessControlSections.Access Or System.Security.AccessControl.AccessControlSections.Owner Or System.Security.AccessControl.AccessControlSections.Group in Visual Basic).

Use the DirectoryInfo.GetAccessControl method to retrieve the access control list (ACL) entries for the current file.

An ACL describes individuals and/or groups who have, or do not have, rights to specific actions on the given file or directory. For more information, see ACL Technology Overview and How to: Add or Remove an Access Control List Entry.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0