InstanceDataCollection.CounterName 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得您要取得之執行個體資料的效能計數器名稱。
public:
property System::String ^ CounterName { System::String ^ get(); };
public string CounterName { get; }
member this.CounterName : string
Public ReadOnly Property CounterName As String
屬性值
效能計數器的名稱。
範例
下列程式代碼範例會顯示 CounterName 的 InstanceDataCollection屬性。
// Display the contents of an InstanceDataCollection.
public static void ProcessInstanceDataCollection(InstanceDataCollection idCol)
{
InstanceData[] instDataArray = new InstanceData[idCol.Count];
Console.WriteLine(" InstanceDataCollection for \"{0}\" " +
"has {1} elements.", idCol.CounterName, idCol.Count);
// Copy and process the InstanceData array.
idCol.CopyTo(instDataArray, 0);
int idX;
for(idX=0; idX<instDataArray.Length; idX++)
{
ProcessInstanceDataObject(instDataArray[idX].InstanceName, instDataArray[idX].Sample);
}
}
' Display the contents of an InstanceDataCollection.
Sub ProcessInstanceDataCollection(ByVal idCol As InstanceDataCollection)
Dim instDataArray(idCol.Count - 1) As InstanceData
Console.WriteLine(" InstanceDataCollection for ""{0}"" " & _
"has {1} elements.", idCol.CounterName, idCol.Count)
' Copy and process the InstanceData array.
idCol.CopyTo(instDataArray, 0)
Dim idX As Integer
For idX = 0 To instDataArray.Length - 1
ProcessInstanceDataObject(instDataArray(idX).InstanceName, _
instDataArray(idX).Sample)
Next idX
End Sub