LogProviderInfos.Item[Object] プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
コレクションから 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 オブジェクト。
例
以下のコード例は、コレクションからアイテムを取得するために2つの方法を用います。 最初の方法は infos[0] 構文を用いて、コレクションの最初の位置にあるオブジェクト全体を取得し、それを lInfo オブジェクトに配置します。 通常通り lInfo オブジェクトからすべてのプロパティを取得することができます。 2つ目の方法は、コレクションの最初のオブジェクトから特定のプロパティを取得する方法を示しています。
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を返すと、この性質は例外を投げ出します。 C# では、このプロパティは LogProviderInfos クラスのインデクサーです。