GenericIdentity Constructor (String)

Initializes a new instance of the GenericIdentity class representing the user with the specified name.

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

Public Sub New ( _
	name As String _
Dim name As String

Dim instance As New GenericIdentity(name)
public GenericIdentity (
	String name
public function GenericIdentity (
	name : String



The name of the user on whose behalf the code is running.

Exception typeCondition


The name parameter is a null reference (Nothing in Visual Basic).

The following code shows the use of the GenericIdentity constructor. This code example is part of a larger example provided for the GenericIdentity class.

Dim defaultIdentity As New GenericIdentity("DefaultUser")

GenericIdentity defaultIdentity = new GenericIdentity("DefaultUser");

Windows 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0