共用方式為


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

檔案資料流已關閉。

適用於