How to get user name using Windows authentication in asp.net?

前端 未结 7 1854
抹茶落季
抹茶落季 2020-12-23 11:43

I want to get user name using Windows authentication

Actually I implemented \"Sign in as different user\",when click this button Windows security will appear there w

7条回答
  •  旧巷少年郎
    2020-12-23 12:28

    Username you get like this:

    var userName = HttpContext.Current.Request.LogonUserIdentity?.Name;
    

提交回复
热议问题