Export (0) Print
Expand All

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 IEnumerator GetEnumerator()



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 void ListUsers(MembershipUserCollection users)
  foreach (MembershipUser u in users)
    Response.Write(u.UserName + "<br />");

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4
© 2015 Microsoft