Read Username from AD C# 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