Membership::GetNumberOfUsersOnline Method ()

 

Gets the number of users currently accessing an application.

Namespace:   System.Web.Security
Assembly:  System.Web (in System.Web.dll)

public:
static int GetNumberOfUsersOnline()

Return Value

Type: System::Int32

The number of users currently accessing an application.

GetNumberOfUsersOnline returns the number of users for the current ApplicationName where the last-activity date is greater than the current time less the UserIsOnlineTimeWindow. The last-activity date/time stamp is updated to the current date and time when user credentials are validated by way of the ValidateUser or UpdateUser method or when a call to a GetUser overload that takes no parameters or one that uses the userIsOnline parameter to specify that the date/time stamp should be updated.

The following code example returns a list of users with a count of the number of users currently online.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: