FileSystemAclExtensions.GetAccessControl Method

Definition

Overloads

GetAccessControl(DirectoryInfo)

Returns the security information of a directory.

GetAccessControl(FileInfo)

Returns the security information of a file.

GetAccessControl(FileStream)

Returns the security information of a file.

GetAccessControl(DirectoryInfo, AccessControlSections)

Returns the security information of a directory.

GetAccessControl(FileInfo, AccessControlSections)

Returns the security information of a file.

GetAccessControl(DirectoryInfo)

Returns the security information of a directory.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Security::AccessControl::DirectorySecurity ^ GetAccessControl(System::IO::DirectoryInfo ^ directoryInfo);
public static System.Security.AccessControl.DirectorySecurity GetAccessControl (this System.IO.DirectoryInfo directoryInfo);
static member GetAccessControl : System.IO.DirectoryInfo -> System.Security.AccessControl.DirectorySecurity
<Extension()>
Public Function GetAccessControl (directoryInfo As DirectoryInfo) As DirectorySecurity

Parameters

directoryInfo
DirectoryInfo

The existing directory from which to obtain the security information.

Returns

DirectorySecurity

The security descriptors of all the access control sections of the directory.

Applies to

GetAccessControl(FileInfo)

Returns the security information of a file.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Security::AccessControl::FileSecurity ^ GetAccessControl(System::IO::FileInfo ^ fileInfo);
public static System.Security.AccessControl.FileSecurity GetAccessControl (this System.IO.FileInfo fileInfo);
static member GetAccessControl : System.IO.FileInfo -> System.Security.AccessControl.FileSecurity
<Extension()>
Public Function GetAccessControl (fileInfo As FileInfo) As FileSecurity

Parameters

fileInfo
FileInfo

The file from which to obtain the security information.

Returns

FileSecurity

The security descriptors of all the access control sections of the file.

Applies to

GetAccessControl(FileStream)

Returns the security information of a file.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Security::AccessControl::FileSecurity ^ GetAccessControl(System::IO::FileStream ^ fileStream);
public static System.Security.AccessControl.FileSecurity GetAccessControl (this System.IO.FileStream fileStream);
static member GetAccessControl : System.IO.FileStream -> System.Security.AccessControl.FileSecurity
<Extension()>
Public Function GetAccessControl (fileStream As FileStream) As FileSecurity

Parameters

fileStream
FileStream

An existing file from which to obtain the security information.

Returns

FileSecurity

The security descriptors of all the access control sections of the file.

Exceptions

fileStream is null.

The file stream is closed.

Applies to

GetAccessControl(DirectoryInfo, AccessControlSections)

Returns the security information of a directory.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Security::AccessControl::DirectorySecurity ^ GetAccessControl(System::IO::DirectoryInfo ^ directoryInfo, System::Security::AccessControl::AccessControlSections includeSections);
public static System.Security.AccessControl.DirectorySecurity GetAccessControl (this System.IO.DirectoryInfo directoryInfo, System.Security.AccessControl.AccessControlSections includeSections);
static member GetAccessControl : System.IO.DirectoryInfo * System.Security.AccessControl.AccessControlSections -> System.Security.AccessControl.DirectorySecurity
<Extension()>
Public Function GetAccessControl (directoryInfo As DirectoryInfo, includeSections As AccessControlSections) As DirectorySecurity

Parameters

directoryInfo
DirectoryInfo

An existing directory from which to obtain the security information.

includeSections
AccessControlSections

The desired access control sections to retrieve.

Returns

DirectorySecurity

The security descriptors of the specified access control sections of the directory.

Applies to

GetAccessControl(FileInfo, AccessControlSections)

Returns the security information of a file.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Security::AccessControl::FileSecurity ^ GetAccessControl(System::IO::FileInfo ^ fileInfo, System::Security::AccessControl::AccessControlSections includeSections);
public static System.Security.AccessControl.FileSecurity GetAccessControl (this System.IO.FileInfo fileInfo, System.Security.AccessControl.AccessControlSections includeSections);
static member GetAccessControl : System.IO.FileInfo * System.Security.AccessControl.AccessControlSections -> System.Security.AccessControl.FileSecurity
<Extension()>
Public Function GetAccessControl (fileInfo As FileInfo, includeSections As AccessControlSections) As FileSecurity

Parameters

fileInfo
FileInfo

An existing file from which to obtain the security information.

includeSections
AccessControlSections

The desired access control sections to retrieve from the file.

Returns

FileSecurity

The security descriptors of the specified access control sections of the file.

Applies to