SecurityException.Demanded Property

Gets or sets the demanded security permission, permission set, or permission set collection that failed.

Namespace: System.Security
Assembly: mscorlib (in mscorlib.dll)

[ComVisibleAttribute(false)] 
public Object Demanded { get; set; }
/** @property */
public Object get_Demanded ()

/** @property */
public void set_Demanded (Object value)

public function get Demanded () : Object

public function set Demanded (value : Object)

Not applicable.

Property Value

A permission, permission set, or permission set collection object.

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.

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. This code example is part of a larger example provided for the SecurityException class.

Display("The demanded permission is: " + 
    sE.Demanded.ToString());

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Show: