Export (0) Print
Expand All

PerformanceCounterCategory.ReadCategory Method

Reads all the counter and performance object instance data that is associated with this performance counter category.

[Visual Basic]
Public Function ReadCategory() As InstanceDataCollectionCollection
[C#]
public InstanceDataCollectionCollection ReadCategory();
[C++]
public: InstanceDataCollectionCollection* ReadCategory();
[JScript]
public function ReadCategory() : InstanceDataCollectionCollection;

Return Value

An InstanceDataCollectionCollection that contains the counter and performance object instance data for the category.

Exceptions

Exception Type Condition
InvalidOperationException The CategoryName property is a null reference (Nothing in Visual Basic). The property might not have been set.
Win32Exception A call to an underlying system API failed.

Remarks

You must set the CategoryName property before you call ReadCategory.

Reading the entire category at once can be as efficient as reading a single counter because of the way that the system provides the data.

Requirements

Platforms: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

PerformanceCounterCategory Class | PerformanceCounterCategory Members | System.Diagnostics Namespace | InstanceDataCollectionCollection | InstanceDataCollection | InstanceData

Show:
© 2014 Microsoft