This documentation is archived and is not being maintained.

PermissionSet.GetEnumerator Method

Returns an enumerator for the permissions of the set.

[Visual Basic]
Public Overridable Function GetEnumerator() As IEnumerator _
   Implements IEnumerable.GetEnumerator
[C#]
public virtual IEnumerator GetEnumerator();
[C++]
public: virtual IEnumerator* GetEnumerator();
[JScript]
public function GetEnumerator() : IEnumerator;

Return Value

An enumerator object for the permissions of the set.

Implements

IEnumerable.GetEnumerator

Remarks

Use the enumerator as an index to access individual permission objects in the set.

Example

[Visual Basic] 
' Display results of PermissionSet.GetEnumerator.
Dim psEnumerator As IEnumerator = ps1.GetEnumerator()
While psEnumerator.MoveNext()
    Console.WriteLine(psEnumerator.Current)
End While

[C#] 
// Display results of PermissionSet.GetEnumerator.
IEnumerator  psEnumerator = ps1.GetEnumerator();
while (psEnumerator.MoveNext())
{
    Console.WriteLine(psEnumerator.Current);
}

[C++] 
// Display results of PermissionSet::GetEnumerator.
IEnumerator*  psEnumerator = ps1->GetEnumerator();
while (psEnumerator->MoveNext()) {
   Console::WriteLine(psEnumerator->Current);
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard

See Also

PermissionSet Class | PermissionSet Members | System.Security Namespace

Show: