MembershipUserCollection.GetEnumerator Method ()

 

Gets an enumerator that can iterate through the membership user collection.

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

Public Function GetEnumerator As IEnumerator

Enumerators only allow reading the data in the collection. Enumerators cannot be used to modify the underlying collection. For more information, see IEnumerator.

The following code example uses the IEnumerator returned from the GetEnumerator method to iterate through a MembershipUserCollection.

Public Sub ListUsers(users As MembershipUserCollection)
  For Each u As MembershipUser in users
    Response.Write(u.UserName & "<br />")
  Next
End Sub

.NET Framework
Available since 2.0
Return to top
Show: