ValidatorCollection.GetEnumerator 메서드

정의

컬렉션의 IEnumerator 인스턴스를 반환합니다 ValidatorCollection .

public:
 virtual System::Collections::IEnumerator ^ GetEnumerator();
public System.Collections.IEnumerator GetEnumerator();
abstract member GetEnumerator : unit -> System.Collections.IEnumerator
override this.GetEnumerator : unit -> System.Collections.IEnumerator
Public Function GetEnumerator () As IEnumerator

반품

컬렉션의 경우입니다 IEnumerator .

구현

예제

다음 코드 예제에서는 메서드를 사용하는 방법을 GetEnumerator 보여 줍니다.

// Get 'Validators' of the page to myCollection.
ValidatorCollection myCollection = Page.Validators;

// Get the Enumerator.
IEnumerator myEnumerator = myCollection.GetEnumerator();
// Print the values in the ValidatorCollection.
string myStr = " ";
while ( myEnumerator.MoveNext() )
{
   myStr += myEnumerator.Current.ToString();
   myStr += " ";
}
messageLabel.Text = myStr;
' Get 'Validators' of the page to myCollection.
Dim myCollection As ValidatorCollection = Page.Validators
' Get the Enumerator.
Dim myEnumerator As IEnumerator = myCollection.GetEnumerator()
' Print the values in the ValidatorCollection.
Dim myStr As String = " "
While myEnumerator.MoveNext()
   myStr += myEnumerator.Current.ToString()
   myStr += " "
End While
messageLabel.Text = myStr

설명

이 메서드를 사용하여 컬렉션의 System.Collections.IEnumerator 각 항목을 쉽게 가져올 수 있는 인스턴스를 ValidatorCollection 만듭니다.

적용 대상

추가 정보