How can i get the DomainName\AccountName with the .NET Framework?

OrElse picture OrElse · Apr 27, 2010 · Viewed 35.9k times · Source

How can i get the

DomainName\AccountName

as string with the .NET Framework?

Answer

codingbadger picture codingbadger · Apr 27, 2010
System.Security.Principal.WindowsIdentity.GetCurrent().Name;