Demand Method
Collapse the table of content
Expand the table of content

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
public virtual void Demand();
public: virtual void Demand();
public function Demand();




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


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


If no SecurityException is raised, Demand succeeds.

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


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

© 2016 Microsoft