FileStream.GetAccessControl FileStream.GetAccessControl FileStream.GetAccessControl FileStream.GetAccessControl Method

定义

获取 FileSecurity 对象,该对象封装当前 FileStream 对象所描述的文件的访问控制列表 (ACL) 项。Gets a FileSecurity object that encapsulates the access control list (ACL) entries for the file described by the current FileStream object.

public:
 System::Security::AccessControl::FileSecurity ^ GetAccessControl();
public System.Security.AccessControl.FileSecurity GetAccessControl ();
member this.GetAccessControl : unit -> System.Security.AccessControl.FileSecurity
Public Function GetAccessControl () As FileSecurity

返回

一个对象,该对象封装当前 FileStream 对象所描述的文件的访问控制设置。An object that encapsulates the access control settings for the file described by the current FileStream object.

异常

打开文件时发生 I/O 错误。An I/O error occurred while opening the file.

找不到文件。The file could not be found.

当前平台不支持此操作。This operation is not supported on the current platform.

- 或 --or- 调用方没有所要求的权限。The caller does not have the required permission.

注解

虽然FileStream类和GetAccessControl可用于检索现有文件的访问控制列表 (ACL) 项,请考虑使用File.GetAccessControl方法,因为它是易于使用。While the FileStream class and GetAccessControl can be used to retrieve the access control list (ACL) entries of an existing file, consider using File.GetAccessControl method, as it is easier to use.

使用GetAccessControl方法来检索文件的 ACL 条目。Use the GetAccessControl method to retrieve the ACL entries for a file.

ACL 描述个人和/或组具有或没有执行到对给定文件的特定操作的权限。An ACL describes individuals and/or groups who have, or do not have, rights to specific actions on the given file. 有关详细信息,请参阅如何:添加或移除访问控制列表项For more information, see How to: Add or Remove Access Control List Entries.

适用于