DataProtectionPermission.Flags 属性

定义

获取或设置数据和内存保护标志。

public:
 property System::Security::Permissions::DataProtectionPermissionFlags Flags { System::Security::Permissions::DataProtectionPermissionFlags get(); void set(System::Security::Permissions::DataProtectionPermissionFlags value); };
public System.Security.Permissions.DataProtectionPermissionFlags Flags { get; set; }
member this.Flags : System.Security.Permissions.DataProtectionPermissionFlags with get, set
Public Property Flags As DataProtectionPermissionFlags

属性值

DataProtectionPermissionFlags

DataProtectionPermissionFlags 值的按位组合。

例外

指定的值不是有效的 DataProtectionPermissionFlags 值组合。

示例

下面的代码示例演示了该 Flags 属性的使用。 此代码示例是为类提供的大型示例的 DataProtectionPermission 一部分。

Console::WriteLine( "Creating the intersection of the second and "
"first permissions." );
sp4 = dynamic_cast<DataProtectionPermission^>(sp2->Intersect( sp1 ));
Console::WriteLine( "The value of the Flags property is: {0}", sp4->Flags );
Console.WriteLine("Creating the intersection of the second and " +
    "first permissions.");
sp4 = (DataProtectionPermission)sp2.Intersect(sp1);
Console.WriteLine("The value of the Flags property is: " +
    sp4.Flags.ToString());
Console.WriteLine("Creating the intersection of the second and " + "first permissions.")
sp4 = CType(sp2.Intersect(sp1), DataProtectionPermission)
Console.WriteLine("The value of the Flags property is: " + sp4.Flags.ToString())

注解

此属性指定是否可以Protect使用和类的ProtectedDataUnprotectProtectedMemory方法。

适用于