Getting a Windows credentials username in c# windows form application

sarsnake picture sarsnake · Dec 20, 2012 · Viewed 13k times · Source

How do I get the currently signed in username in a windows forms application? The app runs on Windows Embedded Standard 7 O/S.

Answer

JaredReisinger picture JaredReisinger · Dec 20, 2012

You probably want Environment.UserName. See http://msdn.microsoft.com/en-us/library/system.environment.username.aspx for details.