InstanceDataCollection.CounterName Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the name of the performance counter whose instance data you want to get.
public:
property System::String ^ CounterName { System::String ^ get(); };
public string CounterName { get; }
member this.CounterName : string
Public ReadOnly Property CounterName As String
Property Value
The performance counter name.
Examples
The following code example displays the CounterName property of an 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
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET