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
。
檔案資料流已關閉。