LogProviderInfos.Item[Object] 속성

정의

컬렉션에서 LogProviderInfo 개체를 가져옵니다. 이 속성은 Item[Object] 클래스의 기본 인덱서 LogProviderInfos 이며 LogProviderInfos[...]를 사용하여 값을 조회할 수 있습니다. 구문을 사용하여 문을 다시 작성해야 합니다.

public:
 property Microsoft::SqlServer::Dts::Runtime::LogProviderInfo ^ default[System::Object ^] { Microsoft::SqlServer::Dts::Runtime::LogProviderInfo ^ get(System::Object ^ index); };
public Microsoft.SqlServer.Dts.Runtime.LogProviderInfo this[object index] { get; }
member this.Item(obj) : Microsoft.SqlServer.Dts.Runtime.LogProviderInfo
Default Public ReadOnly Property Item(index As Object) As LogProviderInfo

매개 변수

index
Object

컬렉션에서 반환할 개체의 이름, 설명, ID 또는 인덱스입니다.

속성 값

LogProviderInfo

컬렉션의 LogProviderInfo 개체입니다.

예제

다음 코드 예제에서는 두 가지 메서드를 사용하여 컬렉션에서 항목을 검색합니다. 첫 번째 메서드는 구문을 사용하여 infos[0] 컬렉션의 첫 번째 위치에 있는 전체 개체를 검색한 다음 개체에 lInfo 배치합니다. 이제 개체에서 평소와 같이 모든 속성을 검색할 lInfo 수 있습니다. 두 번째 메서드는 컬렉션의 첫 번째 개체에서 특정 속성을 검색하는 방법을 보여 줍니다.

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;  

        //Using the Item method syntax of [x], obtain the first entry.  
        LogProviderInfo lInfo = infos[0];  
        String nameOfFirstItem = infos[0].Name;  

        //Print the name of the log provider object located at position [0].  
        Console.WriteLine("The ID of the first log provider is: {0}", lInfo.ID);  
        Console.WriteLine("The Name of the first log provider is: {0}", nameOfFirstItem);  
        }  
    }  
}  
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   

        'Using the Item method syntax of [x], obtain the first entry.  
        Dim lInfo As LogProviderInfo =  infos(0)   
        Dim nameOfFirstItem As String =  infos(0).Name   

        'Print the name of the log provider object located at position [0].  
        Console.WriteLine("The ID of the first log provider is: {0}", lInfo.ID)  
        Console.WriteLine("The Name of the first log provider is: {0}", nameOfFirstItem)  
        End Sub  
    End Class  
End Namespace  

샘플 출력:

첫 번째 로그 공급자의 ID는 {59B2C6A5-663F-4C20-8863-C83F9B72E2EB}입니다.

첫 번째 로그 공급자의 이름은 텍스트 파일용 SSIS 로그 공급자입니다.

설명

메서드 호출이 Contains 반환 true되는 경우 구문을 LogProviderInfos[index]사용하여 컬렉션에서 지정된 요소에 액세스할 수 있습니다. 그러나 메서드가 Contains 반환 false되는 경우 이 속성은 예외를 throw합니다. C#에서 이 속성은 LogProviderInfos 클래스의 인덱서입니다.

적용 대상