This documentation is archived and is not being maintained.

GenericPrincipal Constructor

Initializes a new instance of the GenericPrincipal class from a GenericIdentity and an array of role names to which the user represented by that GenericIdentity belongs.

[Visual Basic]
Public Sub New( _
   ByVal identity As IIdentity, _
   ByVal roles() As String _
public GenericPrincipal(
   IIdentity identity,
 string[] roles
public: GenericPrincipal(
   IIdentity* identity,
 String* roles __gc[]
public function GenericPrincipal(
   identity : IIdentity,
 roles : String[]


A basic implementation of IIdentity that represents any user.
An array of role names to which the user represented by the identity parameter belongs.


Exception Type Condition
ArgumentNullException The identity parameter is a null reference (Nothing in Visual Basic).


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

GenericPrincipal Class | GenericPrincipal Members | System.Security.Principal Namespace