SecurityException.PermitOnlySetInstance 属性
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置权限、权限集或权限集集合,它是导致安全检查失败的唯一允许堆栈帧的一部分。
public:
property System::Object ^ PermitOnlySetInstance { System::Object ^ get(); void set(System::Object ^ value); };
C#
public object? PermitOnlySetInstance { get; set; }
C#
public object PermitOnlySetInstance { get; set; }
C#
[System.Runtime.InteropServices.ComVisible(false)]
public object PermitOnlySetInstance { get; set; }
member this.PermitOnlySetInstance : obj with get, set
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.PermitOnlySetInstance : obj with get, set
Public Property PermitOnlySetInstance As Object
权限、权限集或权限集的集合对象。
- 属性
属性 PermitOnlySetInstance 表示导致安全异常的堆栈帧中包含的允许的权限、权限集或权限集集合。 例如,当由于故障而 PermissionSet.Demand 发生安全异常时,允许的权限将显示在此属性中,所需的 PermissionSet 权限包含在 属性中 Demanded 。
此属性的类型为 Object ,因为权限、权限集或权限集集合都可以要求,并且 Object 是其公共基类。 若要测试此属性的运行时类型,可以使用 GetType 方法或特定语言运算符,例如 C# 中的 is 运算符 或 Visual Basic 中的 TypeOf 运算符 。
产品 | 版本 |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |