Freigeben über


InstanceDataCollectionCollection.Values-Eigenschaft

Ruft die Instanzdaten ab, die die Auflistung von Instanzen für den Zähler enthalten.

Namespace: System.Diagnostics
Assembly: System (in system.dll)

Syntax

'Declaration
Public ReadOnly Property Values As ICollection
'Usage
Dim instance As InstanceDataCollectionCollection
Dim value As ICollection

value = instance.Values
public ICollection Values { get; }
public:
property ICollection^ Values {
    ICollection^ get ();
}
/** @property */
public ICollection get_Values ()
public function get Values () : ICollection

Eigenschaftenwert

Eine ICollection, die die Instanzen des Zählers und die zugeordneten Datenwerte darstellt.

Beispiel

Im folgenden Codebeispiel wird die Values-Eigenschaft von InstanceDataCollectionCollection verwendet, um eine Auflistung von InstanceDataCollection-Objekten zurückzugeben, die in ein Array konvertiert wird. Mit der Keys-Eigenschaft wird ein Array von Zählernamen generiert. Für jedes Element im Array von InstanceDataCollection-Objekten wird der zugeordnete Zählername angezeigt, und es wird eine Funktion aufgerufen, um InstanceDataCollection zu verarbeiten.

' Process the InstanceDataCollectionCollection for this category.
Dim pcc As New PerformanceCounterCategory(categoryName)
Dim idColCol As InstanceDataCollectionCollection = pcc.ReadCategory()

Dim idColColKeys As ICollection = idColCol.Keys
Dim idCCKeysArray(idColColKeys.Count - 1) As String
idColColKeys.CopyTo(idCCKeysArray, 0)

Dim idColColValues As ICollection = idColCol.Values
Dim idCCValuesArray(idColColValues.Count - 1) As InstanceDataCollection
idColColValues.CopyTo(idCCValuesArray, 0)

Console.WriteLine("InstanceDataCollectionCollection for ""{0}"" " & _
    "has {1} elements.", categoryName, idColCol.Count)

' Display the InstanceDataCollectionCollection Keys and Values.
' The Keys and Values collections have the same number of elements.
Dim index As Integer
For index = 0 To idCCKeysArray.Length - 1
    Console.WriteLine("  Next InstanceDataCollectionCollection " & _
        "Key is ""{0}""", idCCKeysArray(index))
    ProcessInstanceDataCollection(idCCValuesArray(index))
Next index

Plattformen

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

InstanceDataCollectionCollection-Klasse
InstanceDataCollectionCollection-Member
System.Diagnostics-Namespace