AppDomainManager.CheckSecuritySettings(SecurityState) 方法

定義

表示應用程式定義域中是否允許指定的作業。Indicates whether the specified operation is allowed in the application domain.

public:
 virtual bool CheckSecuritySettings(System::Security::SecurityState ^ state);
public virtual bool CheckSecuritySettings (System.Security.SecurityState state);
abstract member CheckSecuritySettings : System.Security.SecurityState -> bool
override this.CheckSecuritySettings : System.Security.SecurityState -> bool
Public Overridable Function CheckSecuritySettings (state As SecurityState) As Boolean

參數

state
SecurityState

SecurityState 的子類別,指出要求其安全性狀態的作業。A subclass of SecurityState that identifies the operation whose security status is requested.

傳回

Boolean

如果主機允許在應用程式定義域中執行 state 所指定的作業,則為 true,否則為 falsetrue if the host allows the operation specified by state to be performed in the application domain; otherwise, false.

備註

這個方法的預設實值會傳回 falseThe default implementation of this method returns false.

IsolatedStorageFile.IncreaseQuotaTo呼叫方法來增加隔離儲存區配額時,會呼叫這個方法。This method is called when the IsolatedStorageFile.IncreaseQuotaTo method has been called to increase the isolated storage quota. 裝載 common language runtime (CLR) 的應用程式可以覆寫 CheckSecuritySettings 方法,根據繼承) 的物件 (來執行原則決策 IsolatedStorageSecurityState SecurityState ,然後可以允許或防止增加。An application that hosts the common language runtime (CLR) can override the CheckSecuritySettings method to perform policy decisions based on an IsolatedStorageSecurityState object (which inherits SecurityState), and can then allow or prevent the increase. 例如,主機可能會提示使用者核准或拒絕要求,以增加配額。For example, a host could prompt the end user to approve or deny the request to increase the quota. 主機的執行應該考慮阻絕 CheckSecuritySettings 服務攻擊的可能性。The host's implementation of CheckSecuritySettings should take into account the possibility of denial-of-service attacks. 例如,只有在從使用者起始的事件(例如按一下按鈕)呼叫方法時,才應該提示使用者。For example, it should prompt the user only if the method is called from a user-initiated event such as a button click.

適用於