FileSystemAclExtensions.SetAccessControl 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
SetAccessControl(DirectoryInfo, DirectorySecurity) |
更改现有目录的安全属性。 |
SetAccessControl(FileInfo, FileSecurity) |
更改现有文件的安全属性。 |
SetAccessControl(FileStream, FileSecurity) |
更改现有文件的安全属性。 |
SetAccessControl(DirectoryInfo, DirectorySecurity)
更改现有目录的安全属性。
public:
[System::Runtime::CompilerServices::Extension]
static void SetAccessControl(System::IO::DirectoryInfo ^ directoryInfo, System::Security::AccessControl::DirectorySecurity ^ directorySecurity);
public static void SetAccessControl (this System.IO.DirectoryInfo directoryInfo, System.Security.AccessControl.DirectorySecurity directorySecurity);
static member SetAccessControl : System.IO.DirectoryInfo * System.Security.AccessControl.DirectorySecurity -> unit
<Extension()>
Public Sub SetAccessControl (directoryInfo As DirectoryInfo, directorySecurity As DirectorySecurity)
参数
- directoryInfo
- DirectoryInfo
一个现有目录。
- directorySecurity
- DirectorySecurity
应用于目录的安全信息。
例外
directorySecurity
为 null
。
适用于
SetAccessControl(FileInfo, FileSecurity)
更改现有文件的安全属性。
public:
[System::Runtime::CompilerServices::Extension]
static void SetAccessControl(System::IO::FileInfo ^ fileInfo, System::Security::AccessControl::FileSecurity ^ fileSecurity);
public static void SetAccessControl (this System.IO.FileInfo fileInfo, System.Security.AccessControl.FileSecurity fileSecurity);
static member SetAccessControl : System.IO.FileInfo * System.Security.AccessControl.FileSecurity -> unit
<Extension()>
Public Sub SetAccessControl (fileInfo As FileInfo, fileSecurity As FileSecurity)
参数
- fileInfo
- FileInfo
一个现有文件。
- fileSecurity
- FileSecurity
应用于文件的安全信息。
例外
fileSecurity
为 null
。
适用于
SetAccessControl(FileStream, FileSecurity)
更改现有文件的安全属性。
public:
[System::Runtime::CompilerServices::Extension]
static void SetAccessControl(System::IO::FileStream ^ fileStream, System::Security::AccessControl::FileSecurity ^ fileSecurity);
public static void SetAccessControl (this System.IO.FileStream fileStream, System.Security.AccessControl.FileSecurity fileSecurity);
static member SetAccessControl : System.IO.FileStream * System.Security.AccessControl.FileSecurity -> unit
<Extension()>
Public Sub SetAccessControl (fileStream As FileStream, fileSecurity As FileSecurity)
参数
- fileStream
- FileStream
一个现有文件。
- fileSecurity
- FileSecurity
应用于文件的安全信息。
例外
fileStream
或 fileSecurity
为 null
。
文件流已关闭。