FileSystemAclExtensions.SetAccessControl 方法

定义

重载

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

应用于目录的安全信息。

例外

directorySecuritynull

适用于

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

应用于文件的安全信息。

例外

fileSecuritynull

适用于

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

应用于文件的安全信息。

例外

fileStreamfileSecuritynull

文件流已关闭。

适用于