Home / Code Snippets / Blog article: Get Current Windows User In C#

| RSS

Get Current Windows User In C#

May 12th, 2009 | No Comments | Posted in Code Snippets

This snippet will show you how to get the currently logged in user on windows.

System.Security.Principal.WindowsIdentity identity =
  System.Security.Principal.WindowsIdentity.GetCurrent();

Console.WriteLine(identity.Name);

Leave a Reply 5168 views, 3 so far today |

Leave a Reply