ResourceReader.GetEnumerator 메서드
이 ResourceReader에 대한 열거자를 반환합니다.
네임스페이스: System.Resources
어셈블리: mscorlib(mscorlib.dll)
구문
‘선언
Public Function GetEnumerator As IDictionaryEnumerator
‘사용 방법
Dim instance As ResourceReader
Dim returnValue As IDictionaryEnumerator
returnValue = instance.GetEnumerator
public IDictionaryEnumerator GetEnumerator ()
public:
virtual IDictionaryEnumerator^ GetEnumerator () sealed
public final IDictionaryEnumerator GetEnumerator ()
public final function GetEnumerator () : IDictionaryEnumerator
반환 값
이 ResourceReader에 대한 IDictionaryEnumerator입니다.
예외
예외 형식 | 조건 |
---|---|
reader가 이미 닫혔으므로 액세스할 수 없는 경우 |
예제
Imports System
Imports System.Resources
Imports System.Collections
Imports Microsoft.VisualBasic
Class EnumerateResources
Public Shared Sub Main()
' Create a ResourceReader for the file items.resources.
Dim rr As New ResourceReader("items.resources")
' Create an IDictionaryEnumerator to iterate through the resources.
Dim id As IDictionaryEnumerator = rr.GetEnumerator()
' Iterate through the resources and display the contents to the console.
While id.MoveNext()
Console.WriteLine(ControlChars.NewLine + "[{0}] " + ControlChars.Tab + "{1}", id.Key, id.Value)
End While
rr.Close()
End Sub
End Class
using System;
using System.Resources;
using System.Collections;
class EnumerateResources
{
public static void Main()
{
// Create a ResourceReader for the file items.resources.
ResourceReader rr = new ResourceReader("items.resources");
// Create an IDictionaryEnumerator to iterate through the resources.
IDictionaryEnumerator id = rr.GetEnumerator();
// Iterate through the resources and display the contents to the console.
while(id.MoveNext())
Console.WriteLine("\n[{0}] \t{1}", id.Key, id.Value);
rr.Close();
}
}
using namespace System;
using namespace System::Resources;
using namespace System::Collections;
int main()
{
// Create a ResourceReader for the file items.resources.
ResourceReader^ rr = gcnew ResourceReader( "items.resources" );
// Create an IDictionaryEnumerator* to iterate through the resources.
IDictionaryEnumerator^ id = rr->GetEnumerator();
// Iterate through the resources and display the contents to the console.
while ( id->MoveNext() )
Console::WriteLine( "\n [{0}] \t {1}", id->Key, id->Value );
rr->Close();
}
import System.*;
import System.Resources.*;
import System.Collections.*;
class EnumerateResources
{
public static void main(String[] args)
{
// Create a ResourceReader for the file items.resources.
ResourceReader rr = new ResourceReader("items.resources");
// Create an IDictionaryEnumerator to iterate through the resources.
IDictionaryEnumerator id = rr.GetEnumerator();
// Iterate through the resources and display the
// contents to the console.
while (id.MoveNext()) {
Console.WriteLine("\n[{0}] \t{1}", id.get_Key(), id.get_Value());
}
rr.Close();
} //main
} //EnumerateResources
플랫폼
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
2.0, 1.1, 1.0에서 지원
.NET Compact Framework
2.0, 1.0에서 지원
참고 항목
참조
ResourceReader 클래스
ResourceReader 멤버
System.Resources 네임스페이스
IDictionary
IDictionaryEnumerator