Sunday, June 30, 2019

How do I get the current username in .NET using C#?



How do I get the current username in .NET using C#?


Answer



string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;

No comments:

Post a Comment