Export (0) Print
Expand All

PrincipalPermission.Demand Method

Determines at run time whether the current principal matches that specified by the current permission.

[Visual Basic]
Public Overridable Sub Demand() Implements IPermission.Demand
[C#]
public virtual void Demand();
[C++]
public: virtual void Demand();
[JScript]
public function Demand();

Implements

IPermission.Demand

Exceptions

Exception Type Condition
SecurityException The current principal does not pass the security check for the principal specified by the current permission.

-or-

The current IPrincipal is a null reference (Nothing in Visual Basic).

Remarks

If no SecurityException is raised, Demand succeeds.

This method acts against the principal attached to the calling thread.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

PrincipalPermission Class | PrincipalPermission Members | System.Security.Permissions Namespace | Security Demands

Show:
© 2014 Microsoft