I am building a small intranet app in which I need to display the user name of the person who opens the webpage.
I tries with:
WindowsIdentity.GetCurrent().Name.ToString();
But this always displays my user name on the webpage.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Please see THIS – basicaly you need to enable
Integrated windows authenticationand the use one of the following:or
or
All 3 cases should retrun a string containing
DomainName\WinNTLoggedUserName.