AppDomainManager.CheckSecuritySettings(SecurityState) 方法


指示是否允许在应用程序域中执行指定的操作。Indicates whether the specified operation is allowed in the application domain.

 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



SecurityState 的一个子类,用来标识请求其安全状态的操作。A subclass of SecurityState that identifies the operation whose security status is requested.


如果宿主允许在应用程序域中执行 true 指定的操作,则为 state;否则为 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. 托管公共语言运行时(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.