System.Web.Security.Membership.GetNumberOfUsersOnline Method

Gets the number of users currently accessing an application.

Syntax

public static int GetNumberOfUsersOnline ()

Returns

The number of users currently accessing an application.

Remarks

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

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0