How do I get the current username in .NET using C#?
Answer
string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...
No comments:
Post a Comment