DataProtectionPermission.Flags 属性

定义

获取或设置数据和内存保护标志。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

属性值

DataProtectionPermissionFlags

DataProtectionPermissionFlags 值的按位组合。A bitwise combination of the DataProtectionPermissionFlags values.

例外

指定的值不是有效的 DataProtectionPermissionFlags 值组合。The specified value is not a valid combination of the DataProtectionPermissionFlags values.

示例

下面的代码示例演示如何使用 Flags 属性。The following code example shows the use of the Flags property. 此代码示例是为 DataProtectionPermission 类提供的更大示例的一部分。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())

注解

此属性指定是否可以使用 ProtectedDataProtectedMemory 类的 ProtectUnprotect 方法。This property specifies whether the Protect and Unprotect methods of the ProtectedData and ProtectedMemory classes can be used.

适用于