Discussion Locked

User Login- Windows Identity

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Dear all,
If we have 1000 employees in office,every one having their own user id or employee number.
How can I display their Employee number in ASP page?
When the people open a particular web page which is created by ASP.Net,at the time their page should show their employee number.
This employee number should be displayed based on the user login.
I have used the below code:
WindowsIdentity id=WindowsIdentity.GetCurrent();
Response.Write(id.Name);
But it doesn't working! It shows:NT AUTHORITY\NETWORK SERVICE
How can I get user's employee number in web page?
Please let me know.Thanks in advance

2 replies

by lowlands

You'll also have to make sure to set your webpage (on IIS i assume) to use Windows authentication and not anonymous access for the method you describe above to work.

This discussion is closed to new replies.