HostSecurityManager.Flags 属性

定义

获取表示与主机相关的安全策略组件的标志。Gets the flag representing the security policy components of concern to the host.

public:
 virtual property System::Security::HostSecurityManagerOptions Flags { System::Security::HostSecurityManagerOptions get(); };
public virtual System.Security.HostSecurityManagerOptions Flags { get; }
member this.Flags : System.Security.HostSecurityManagerOptions
Public Overridable ReadOnly Property Flags As HostSecurityManagerOptions

属性值

HostSecurityManagerOptions

用于指定安全策略组件的枚举值之一。One of the enumeration values that specifies security policy components. 默认值为 AllFlagsThe default is AllFlags.

示例

下面的示例演示如何重写 Flags 自定义宿主安全管理器的属性。The following example shows how to override the Flags property for a custom host security manager. 此示例是为类提供的更大示例的一部分 HostSecurityManagerThis example is part of a larger example provided for the HostSecurityManager class.

private HostSecurityManagerOptions hostFlags = HostSecurityManagerOptions.HostDetermineApplicationTrust |
                                           HostSecurityManagerOptions.HostAssemblyEvidence;
public override HostSecurityManagerOptions Flags
{
    get
    {
        return hostFlags;
    }
}
Private hostFlags As HostSecurityManagerOptions = HostSecurityManagerOptions.HostDetermineApplicationTrust Or HostSecurityManagerOptions.HostAssemblyEvidence

Public Overrides ReadOnly Property Flags() As HostSecurityManagerOptions
    Get
        Return hostFlags
    End Get
End Property

注解

此属性可在派生类中重写。This property can be overridden in a derived class. 此基实现总是返回 AllFlagsThe base implementation always returns AllFlags.

当只关注的一个子集时,派生的主机可以更改此属性的值 HostSecurityManagerOptionsThe derived host can change the value of this property when only a subset of the HostSecurityManagerOptions is of interest. 可能的子集包括 none、拒绝集、策略级别和程序集证据。The possible subsets include none, the refused set, the policy level, and assembly evidence.

适用于