Created
January 13, 2020 22:25
-
-
Save yhau1989/ef40b27e86acd68d0c415838c9c7db37 to your computer and use it in GitHub Desktop.
Get Current User .NET C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected string detecUser() | |
{ | |
return (HttpContext.Current.User.Identity.Name.Length > 0) ? HttpContext.Current.User.Identity.Name : System.Security.Principal.WindowsIdentity.GetCurrent().Name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment