IIdentity.Name Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the name of the current user.

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

string Name { get; }

Property Value

Type: System.String

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

The user name is passed to the common language runtime by the operating system or other authentication provider (such as ASP.NET).

Name is typically set to an empty string ("") for an unauthenticated entity, but can take other values.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: