문제

I am building a web application for my school's intranet. Whenever teachers try to access the browser to access the intranet page a popup appears so they can login, in my page I need to get the logged username. do any of you guys know how to do that?

System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();

The code above is what I've managed to do so far which gets the username of the user loggin in on windows but that's not really what I want.

도움이 되었습니까?

해결책

you can use simply the following statement :

HttpContext.Current.User.Identity.Name
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top