简体   繁体   中英

how to monitor the website login in Asp.net

I have a ASP.NET website with Login screen. It is having various levels of login like admin,employee,client...etc.

my target is to monitor the login.

Suppose if an employee logged in to the web app from one pc and tried to login for the same employee from another pc,i should able to monitor that by displaying a message saying that same employee logged in another pc and need to logout from the first login. '

How can i achieve this efficiently?

You can add one more column in the table where login information are kept. Let's name this new column "Logged_PC_IP". Store the logged in PC's ip address in the new column.You can refer this link for information regarding retrieving local ip address using c#

Every time the user is signing in the code must be checking the user's records in the login table. Modify the code behind file to check for the logged in ip with an additional and clause in your select statement. If the PC's ip and stored ip does not match you can display the error message in a label control.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM