SecurityException.Demanded 屬性

定義

取得或設定失敗之要求的安全性權限、權限集或權限集集合。Gets or sets the demanded security permission, permission set, or permission set collection that failed.

public:
 property System::Object ^ Demanded { System::Object ^ get(); void set(System::Object ^ value); };
public object? Demanded { get; set; }
public object Demanded { get; set; }
[System.Runtime.InteropServices.ComVisible(false)]
public object Demanded { get; set; }
member this.Demanded : obj with get, set
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.Demanded : obj with get, set
Public Property Demanded As Object

屬性值

Object

權限、權限集或權限集集合物件。A permission, permission set, or permission set collection object.

屬性

範例

下列程式碼範例示範 Demanded 如何使用屬性來顯示失敗的要求安全性許可權、許可權集或許可權集集合。The following code example shows the use of the Demanded property to display the demanded security permission, permission set, or permission set collection that failed. 這個程式碼範例是針對類別提供之較大範例的一部分 SecurityExceptionThis code example is part of a larger example provided for the SecurityException class.

Display("The demanded permission is: {0}",
    exception->Demanded);
Display("The demanded permission is: " + 
    sE.Demanded.ToString());
Display("The demanded permission is: " & sE.Demanded.ToString())

備註

在傳回的許可權集合或許可權集集合的情況下,傳回的物件會包含所有要求的許可權,也就是造成失敗的一或多個許可權。In the case of a returned permission set or permission set collection, the returned object contains all the demanded permissions, one or more of which caused the failure.

適用於