Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check in ASP.NET if the user is online?

Tags:

asp.net

vb.net

what is the logic behind this on this website "last activity: 1 min ago from this ip address " If you are obtaining the user's IP address in a hidden field , how can I do this in vb.net ?

And how can I check how many users are online using the application ?

like image 609
ahmed Avatar asked Nov 26 '22 19:11

ahmed


1 Answers

The ASP.NET Membership service supports this feature. To get the particular user's last activity date, use LastActivityDate property and to indicate whether the user is online or not use IsOnline property. Also to get the number of online users, use GetNumberOfOnlineUsers. Of course, the ASP.NET Membership service does not save the last IP address, and you have to override some behavior of SqlMembershipProvider in this case.

like image 160
Mehdi Golchin Avatar answered Dec 05 '22 00:12

Mehdi Golchin