Export (0) Print
Expand All

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 GenericIdentity (
	string name
)
public GenericIdentity (
	String name
)
public function GenericIdentity (
	name : String
)

Parameters

name

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

Exception typeCondition

ArgumentNullException

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.

GenericIdentity defaultIdentity = 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

Community Additions

ADD
Show:
© 2014 Microsoft