Question

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.

Was it helpful?

Solution

you can use simply the following statement :

HttpContext.Current.User.Identity.Name
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top