0

Hi, trying to get the username of the user logged into a computer but it doesn't appear to be working. I was using Label1.Text = User.Identity.Name; to check if it did work but it wasn't displaying anything. The only reason I need the username is to send it through to an SQL stored procedure to keep track of who is downloading reports that are being generated, this system will be an internal system for a company. Any help with this would be great, thank you.

3
Contributors
3
Replies
12
Views
2 Years
Discussion Span
Last Post by JorgeM
0

Are you storing the logged in user's user name anywhere? In a session variable for instance?
Withoutknowing what you are doing to persist the user name after a successful login there isn't much advice we can give.
For example, User.Identity.Name doesn't get populated with a value without you making it so.

0

The user doesn't have to log in to the system. I'm trying to get the username they use to log on to the computer. Not sure if this can be done or not.

0

For you to get that information using User.Identity.Name, the website needs to be configured (in IIS) by enabling Windows Authentication and disabling anonymous authentication. With that action, you will get the logged on userid.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.