语言

ForEachEnumeratorInfos.Item[Object] 属性

定义

返回 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 或索引。

属性值

ForEachEnumeratorInfo 对象。

示例

以下代码示例通过索引和名称从集合中检索一个项,使用语法。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}

适用于