Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library

SimpleMembershipProvider.GetNumberOfUsersOnline Method

Returns the number of users who are currently accessing the application.

Namespace:  WebMatrix.WebData
Assembly:  WebMatrix.WebData (in WebMatrix.WebData.dll)

'Declaration
Public Overrides Function GetNumberOfUsersOnline As Integer
'Usage
Dim instance As SimpleMembershipProvider
Dim returnValue As Integer

returnValue = instance.GetNumberOfUsersOnline()

Return Value

Type: System.Int32
The number of users who are currently accessing the application.

This method returns the count of all of the users in the data source where the LastActivityDate value is greater than the current date and time minus the UserIsOnlineTimeWindow value. The UserIsOnlineTimeWindow value specifies the number of minutes to use when determining whether a user is online.

NoteNote:

If the SimpleMembershipProvider class has been initialized using a call to the WebSecurity.InitializeDatabaseConnection method, this method is not supported and will throw a NotSupportedException exception. However, if the WebSecurity.InitializeDatabaseConnection method has not been called, and if you have configured your site to use the standard ASP.NET membership provider, this method is passed through to the standard membership provider. For more information, see the SimpleMembershipProvider class overview.

  • Medium trust for the immediate caller. This member can be used by partially trusted code.
Show:
© 2015 Microsoft