Pregunta

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.

¿Fue útil?

Solución

you can use simply the following statement :

HttpContext.Current.User.Identity.Name
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top