共用方式為


DiscoveryClientDocumentCollection.Keys 屬性

定義

取得具有 ICollection 中所有索引鍵的 DiscoveryClientDocumentCollection 物件。

public:
 property System::Collections::ICollection ^ Keys { System::Collections::ICollection ^ get(); };
public System.Collections.ICollection Keys { get; }
member this.Keys : System.Collections.ICollection
Public ReadOnly Property Keys As ICollection

屬性值

ICollection,包含 DiscoveryClientDocumentCollection 的索引鍵。

範例

下列程式碼範例會將 內的 DiscoveryClientDocumentCollection 索引鍵輸出至主控台。

ICollection^ myCollection = myDiscoveryClientDocumentCollection->Keys;
array<Object^>^myObjectCollection =
   gcnew array<Object^>(myDiscoveryClientDocumentCollection->Count);
myCollection->CopyTo( myObjectCollection, 0 );
Console::WriteLine( "The discovery documents in the collection are :" );
for ( int iIndex = 0; iIndex < myObjectCollection->Length; iIndex++ )
   Console::WriteLine( myObjectCollection[ iIndex ] );
ICollection myCollection = myDiscoveryClientDocumentCollection.Keys;
object[] myObjectCollection =
               new object[myDiscoveryClientDocumentCollection.Count];
myCollection.CopyTo(myObjectCollection, 0);
Console.WriteLine("The discovery documents in the collection are :");
for (int iIndex=0; iIndex < myObjectCollection.Length; iIndex++)
{
   Console.WriteLine(myObjectCollection[iIndex]);
}
Dim myCollection As ICollection = myDiscoveryClientDocumentCollection.Keys
Dim myObjectCollection(myDiscoveryClientDocumentCollection.Count-1) As Object
myCollection.CopyTo(myObjectCollection, 0)
Console.WriteLine("The discovery documents in the collection are :")
Dim iIndex As Integer
For iIndex = 0 To myObjectCollection.Length - 1
   Console.WriteLine(myObjectCollection(iIndex))
Next iIndex

適用於

另請參閱