다음을 통해 공유


LogProviderInfos.GetEnumerator 메서드

정의

LogProviderInfos 컬렉션을 반복하는 데 사용할 열거자를 반환합니다.

public:
 Microsoft::SqlServer::Dts::Runtime::LogProviderInfoEnumerator ^ GetEnumerator();
public Microsoft.SqlServer.Dts.Runtime.LogProviderInfoEnumerator GetEnumerator ();
override this.GetEnumerator : unit -> Microsoft.SqlServer.Dts.Runtime.LogProviderInfoEnumerator
Public Function GetEnumerator () As LogProviderInfoEnumerator

반환

LogProviderInfoEnumerator

컬렉션을 반복하는 데 사용할 LogProviderInfoEnumerator 열거자입니다.

예제

다음 코드 샘플에서는 메서드를 LogProviderInfoEnumerator 사용하여 GetEnumerator 만든 다음 컬렉션을 반복합니다.

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  

namespace LogProvInfoProperties  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
        Application app = new Application();  
        LogProviderInfos infos = app.LogProviderInfos;  

        //Create the Enumerator.  
        LogProviderInfoEnumerator myEnumerator = infos.GetEnumerator();  
        Console.WriteLine("The collection contains the following values:");  
        //Iterate over the collection using the indexer instead of foreach.  
        int i = 0;  
            while ((myEnumerator.MoveNext()) && (myEnumerator.Current != null))  
                Console.WriteLine("[{0}] {1}", i++, myEnumerator.Current.Name);  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace LogProvInfoProperties  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
        Dim app As Application =  New Application()   
        Dim infos As LogProviderInfos =  app.LogProviderInfos   

        'Create the Enumerator.  
        Dim myEnumerator As LogProviderInfoEnumerator =  infos.GetEnumerator()   
        Console.WriteLine("The collection contains the following values:")  
        'Iterate over the collection using the indexer instead of foreach.  
        Dim i As Integer =  0   
            While (myEnumerator.MoveNext()) &&(myEnumerator.Current <> Nothing)  
            Console.WriteLine("[{0}] {1}",i = Console.WriteLine("[{0}] {1}",i + 1  
            End While  
         End Sub  
    End Class  
End Namespace  

샘플 출력:

컬렉션에는 다음 값이 포함됩니다.

[0] 텍스트 파일에 대한 SSIS 로그 공급자

[1] SQL Server Profiler SSIS 로그 공급자

[2] SQL Server SSIS 로그 공급자

[3] Windows 이벤트 로그용 SSIS 로그 공급자

[4] XML 파일에 대한 SSIS 로그 공급자

적용 대상