CodeGroup.PolicyStatement 属性

定义

获取或设置与该代码组关联的策略声明。

public:
 property System::Security::Policy::PolicyStatement ^ PolicyStatement { System::Security::Policy::PolicyStatement ^ get(); void set(System::Security::Policy::PolicyStatement ^ value); };
public System.Security.Policy.PolicyStatement PolicyStatement { get; set; }
member this.PolicyStatement : System.Security.Policy.PolicyStatement with get, set
Public Property PolicyStatement As PolicyStatement

属性值

PolicyStatement

该代码组的策略声明。

示例

以下示例设置 PolicyStatement 代码组。

codeGroup->PolicyStatement = gcnew PolicyStatement( gcnew NamedPermissionSet( "MyPermissionSet" ) );
codeGroup.PolicyStatement = new PolicyStatement(new NamedPermissionSet("MyPermissionSet"));
codeGroup.PolicyStatement = New PolicyStatement(New NamedPermissionSet("MyPermissionSet"))

注解

当证据与成员身份条件匹配时,策略语句适用于程序集中的代码。

还可以通过将策略语句传递给构造函数来设置此属性。

适用于