.NET Framework 4.6 and 4.5
Gets the name of the current user.
(in mscorlib.dll) System.Security.Principal
Type: System.StringThe 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.
Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
.NET Framework Client Profile
Supported in: 4, 3.5 SP1
Portable Class Library
Supported in: Portable Class Library
Supported in: Windows Phone 8.1
Supported in: Windows Phone Silverlight 8.1
Supported in: Windows Phone Silverlight 8