c# how to get windows username code example
Example 1: c# get username
string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
Example 2: c# get username
Environment.UserName
string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
Environment.UserName