Прочетете на английски Редактиране

Споделяне чрез


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.

C#
public static System.Security.AccessControl.DirectorySecurity GetAccessControl(this System.IO.DirectoryInfo directoryInfo);

Parameters

directoryInfo
DirectoryInfo

The existing directory from which to obtain the security information.

Returns

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

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5

GetAccessControl(FileInfo)

Returns the security information of a file.

C#
public static System.Security.AccessControl.FileSecurity GetAccessControl(this System.IO.FileInfo fileInfo);

Parameters

fileInfo
FileInfo

The file from which to obtain the security information.

Returns

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

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5

GetAccessControl(FileStream)

Returns the security information of a file.

C#
public static System.Security.AccessControl.FileSecurity GetAccessControl(this System.IO.FileStream fileStream);

Parameters

fileStream
FileStream

An existing file from which to obtain the security information.

Returns

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

Exceptions

fileStream is null.

The file stream is closed.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5

GetAccessControl(DirectoryInfo, AccessControlSections)

Returns the security information of a directory.

C#
public static System.Security.AccessControl.DirectorySecurity GetAccessControl(this System.IO.DirectoryInfo directoryInfo, System.Security.AccessControl.AccessControlSections includeSections);

Parameters

directoryInfo
DirectoryInfo

An existing directory from which to obtain the security information.

includeSections
AccessControlSections

The desired access control sections to retrieve.

Returns

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

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5

GetAccessControl(FileInfo, AccessControlSections)

Returns the security information of a file.

C#
public static System.Security.AccessControl.FileSecurity GetAccessControl(this System.IO.FileInfo fileInfo, System.Security.AccessControl.AccessControlSections includeSections);

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

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

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5