ForEachEnumeratorInfos.Item[Object] 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從集合中回傳一個 ForEachEnumeratorInfo 物件。
public:
property Microsoft::SqlServer::Dts::Runtime::ForEachEnumeratorInfo ^ default[System::Object ^] { Microsoft::SqlServer::Dts::Runtime::ForEachEnumeratorInfo ^ get(System::Object ^ index); };
public Microsoft.SqlServer.Dts.Runtime.ForEachEnumeratorInfo this[object index] { get; }
member this.Item(obj) : Microsoft.SqlServer.Dts.Runtime.ForEachEnumeratorInfo
Default Public ReadOnly Property Item(index As Object) As ForEachEnumeratorInfo
參數
- index
- Object
從集合回傳物件的名稱、ID 或索引。
屬性值
範例
以下程式碼範例透過索引與名稱從集合中檢索項目,並使用語法。feInfos[0]
注意
若要使用以下程式碼範例,使用非英語的區域,請將字串「For Each Item Enumerator」改為該列舉器的在地名稱。
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace TaskInfos_Item
{
class Program
{
static void Main(string[] args)
{
Application app = new Application();
ForEachEnumeratorInfos feInfos = app.ForEachEnumeratorInfos;
//Using the Item method syntax of [x], obtain the
//description of the first entry.
ForEachEnumeratorInfo feInfo = feInfos[0];
String nameOfFirstItem = feInfos[0].Name;
Console.WriteLine("Description of ForEach entry: {0}", nameOfFirstItem);
//Using the Item method syntax of [x], obtain the ID
// of the entry with the name, For Each Item Enumerator.
feInfo = feInfos["For Each Item Enumerator"];
String IDOfItem = feInfos["For Each Item Enumerator"].ID;
Console.WriteLine("ID of ForEach entry: {0}", IDOfItem);
}
}
}
範例輸出:
每個條目:每個檔案列舉器的說明
ForEach 條目編號:{62C3D0DC-C6A3-4A08-84F3-6028B2452F41}