NativeObjectSecurity.Persist 方法

定義

將與這個 NativeObjectSecurity 物件相關聯之安全性描述元的指定區段儲存到永久儲存區。

多載

Persist(SafeHandle, AccessControlSections)

將與這個 NativeObjectSecurity 物件相關聯之安全性描述元的指定區段儲存到永久儲存區。 建議您保留傳遞到建構函式的 includeSections 參數值,並維持方法相同。

Persist(String, AccessControlSections)

將與這個 NativeObjectSecurity 物件相關聯之安全性描述元的指定區段儲存到永久儲存區。 建議傳遞至建構函式和保存方法之 includeSections 參數的值應完全相同。

Persist(SafeHandle, AccessControlSections, Object)

將與這個 NativeObjectSecurity 物件相關聯之安全性描述元的指定區段儲存到永久儲存區。 建議傳遞至建構函式和保存方法之 includeSections 參數的值應完全相同。

Persist(String, AccessControlSections, Object)

將與這個 NativeObjectSecurity 物件相關聯之安全性描述元的指定區段儲存到永久儲存區。 建議傳遞至建構函式和保存方法之 includeSections 參數的值應完全相同。

Persist(SafeHandle, AccessControlSections)

將與這個 NativeObjectSecurity 物件相關聯之安全性描述元的指定區段儲存到永久儲存區。 建議您保留傳遞到建構函式的 includeSections 參數值,並維持方法相同。

protected:
 override void Persist(System::Runtime::InteropServices::SafeHandle ^ handle, System::Security::AccessControl::AccessControlSections includeSections);
protected override sealed void Persist (System.Runtime.InteropServices.SafeHandle handle, System.Security.AccessControl.AccessControlSections includeSections);
override this.Persist : System.Runtime.InteropServices.SafeHandle * System.Security.AccessControl.AccessControlSections -> unit
Protected Overrides NotOverridable Sub Persist (handle As SafeHandle, includeSections As AccessControlSections)

參數

handle
SafeHandle

與這個 NativeObjectSecurity 物件關聯之安全物件的控制代碼。

includeSections
AccessControlSections

AccessControlSections 列舉值的其中一個,指定安全物件的安全性描述元 (存取規則、稽核規則、擁有者、主要群組) 的區段。

例外狀況

與這個 NativeObjectSecurity 物件相關聯的安全性物件為目錄或檔案,但找不到該目錄或檔案。

備註

保存 NativeObjectSecurity 物件時,如果傳遞至 Persist 方法的參數 includeSections 值與傳遞至用來建立該 NativeObjectSecurity 物件的建構函式的參數值 includeSections 不相同,則保存 NativeObjectSecurity 物件的區段可以包含無法預測的值。 例如,如果使用 的值 Access 呼叫建構函 includeSections 式,而稍後 Persist 在該物件上呼叫值為 All 的方法,產生的保存 NativeObjectSecurity 物件 includeSections 將包含其稽核規則、群組和擁有者無法預期的值。

適用於

Persist(String, AccessControlSections)

將與這個 NativeObjectSecurity 物件相關聯之安全性描述元的指定區段儲存到永久儲存區。 建議傳遞至建構函式和保存方法之 includeSections 參數的值應完全相同。

protected:
 override void Persist(System::String ^ name, System::Security::AccessControl::AccessControlSections includeSections);
protected override sealed void Persist (string name, System.Security.AccessControl.AccessControlSections includeSections);
override this.Persist : string * System.Security.AccessControl.AccessControlSections -> unit
Protected Overrides NotOverridable Sub Persist (name As String, includeSections As AccessControlSections)

參數

name
String

安全物件的名稱,這個 NativeObjectSecurity 物件與其相關聯。

includeSections
AccessControlSections

AccessControlSections 列舉值的其中一個,指定安全物件的安全性描述元 (存取規則、稽核規則、擁有者、主要群組) 的區段。

例外狀況

與這個 NativeObjectSecurity 物件相關聯的安全性物件為目錄或檔案,但找不到該目錄或檔案。

備註

保存 NativeObjectSecurity 物件時,如果傳遞至 Persist 方法的參數 includeSections 值與傳遞至用來建立該 NativeObjectSecurity 物件的建構函式的參數值 includeSections 不相同,則保存 NativeObjectSecurity 物件的區段可以包含無法預測的值。 例如,如果使用 的值 Access 呼叫建構函 includeSections 式,而稍後 Persist 在該物件上呼叫值為 All 的方法,產生的保存 NativeObjectSecurity 物件 includeSections 將包含其稽核規則、群組和擁有者無法預期的值。

適用於

Persist(SafeHandle, AccessControlSections, Object)

將與這個 NativeObjectSecurity 物件相關聯之安全性描述元的指定區段儲存到永久儲存區。 建議傳遞至建構函式和保存方法之 includeSections 參數的值應完全相同。

protected:
 void Persist(System::Runtime::InteropServices::SafeHandle ^ handle, System::Security::AccessControl::AccessControlSections includeSections, System::Object ^ exceptionContext);
protected void Persist (System.Runtime.InteropServices.SafeHandle handle, System.Security.AccessControl.AccessControlSections includeSections, object exceptionContext);
protected void Persist (System.Runtime.InteropServices.SafeHandle handle, System.Security.AccessControl.AccessControlSections includeSections, object? exceptionContext);
override this.Persist : System.Runtime.InteropServices.SafeHandle * System.Security.AccessControl.AccessControlSections * obj -> unit
Protected Sub Persist (handle As SafeHandle, includeSections As AccessControlSections, exceptionContext As Object)

參數

handle
SafeHandle

與這個 NativeObjectSecurity 物件關聯之安全物件的控制代碼。

includeSections
AccessControlSections

AccessControlSections 列舉值的其中一個,指定安全物件的安全性描述元 (存取規則、稽核規則、擁有者、主要群組) 的區段。

exceptionContext
Object

包含來源或目的地例外狀況相關內容資訊的物件。

例外狀況

與這個 NativeObjectSecurity 物件相關聯的安全性物件為目錄或檔案,但找不到該目錄或檔案。

備註

保存 NativeObjectSecurity 物件時,如果傳遞至 Persist 方法的參數 includeSections 值與傳遞至用來建立該 NativeObjectSecurity 物件的建構函式的參數值 includeSections 不相同,則保存 NativeObjectSecurity 物件的區段可以包含無法預測的值。 例如,如果使用 的值 Access 呼叫建構函 includeSections 式,而稍後 Persist 在該物件上呼叫值為 All 的方法,產生的保存 NativeObjectSecurity 物件 includeSections 將包含其稽核規則、群組和擁有者無法預期的值。

適用於

Persist(String, AccessControlSections, Object)

將與這個 NativeObjectSecurity 物件相關聯之安全性描述元的指定區段儲存到永久儲存區。 建議傳遞至建構函式和保存方法之 includeSections 參數的值應完全相同。

protected:
 void Persist(System::String ^ name, System::Security::AccessControl::AccessControlSections includeSections, System::Object ^ exceptionContext);
protected void Persist (string name, System.Security.AccessControl.AccessControlSections includeSections, object exceptionContext);
protected void Persist (string name, System.Security.AccessControl.AccessControlSections includeSections, object? exceptionContext);
override this.Persist : string * System.Security.AccessControl.AccessControlSections * obj -> unit
Protected Sub Persist (name As String, includeSections As AccessControlSections, exceptionContext As Object)

參數

name
String

安全物件的名稱,這個 NativeObjectSecurity 物件與其相關聯。

includeSections
AccessControlSections

AccessControlSections 列舉值的其中一個,指定安全物件的安全性描述元 (存取規則、稽核規則、擁有者、主要群組) 的區段。

exceptionContext
Object

包含來源或目的地例外狀況相關內容資訊的物件。

例外狀況

與這個 NativeObjectSecurity 物件相關聯的安全性物件為目錄或檔案,但找不到該目錄或檔案。

備註

保存 NativeObjectSecurity 物件時,如果傳遞至 Persist 方法的參數 includeSections 值與傳遞至用來建立該 NativeObjectSecurity 物件的建構函式的參數值 includeSections 不相同,則保存 NativeObjectSecurity 物件的區段可以包含無法預測的值。 例如,如果使用 的值 Access 呼叫建構函 includeSections 式,而稍後 Persist 在該物件上呼叫值為 All 的方法,產生的保存 NativeObjectSecurity 物件 includeSections 將包含其稽核規則、群組和擁有者無法預期的值。

適用於