Redigera

Dela via


DataProtectionPermission.Flags Property

Definition

Gets or sets the data and memory protection 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

Property Value

A bitwise combination of the DataProtectionPermissionFlags values.

Exceptions

The specified value is not a valid combination of the DataProtectionPermissionFlags values.

Examples

The following code example shows the use of the Flags property. This code example is part of a larger example provided for the DataProtectionPermission class.

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())

Remarks

This property specifies whether the Protect and Unprotect methods of the ProtectedData and ProtectedMemory classes can be used.

Applies to