Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

InstanceDataCollectionCollection::Item Property (String^)

 

Gets the instance data for the specified counter.

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

public:
property InstanceDataCollection^ default[
	String^ counterName
] {
	InstanceDataCollection^ get(String^ counterName);
}

Parameters

counterName
Type: System::String^

The name of the performance counter.

Property Value

Type: System.Diagnostics::InstanceDataCollection^

An InstanceDataCollection item, by which the InstanceDataCollectionCollection object is indexed.

Exception Condition
ArgumentNullException

The counterName parameter is null.

The counterName parameter is case-insensitive.

Each InstanceDataCollection object in the collection contains the performance data for all counters for an instance. The data is indexed by counter name and then by instance name. The indexer uses the counterName parameter to step through the counters associated with this collection of instance data.

The following code example accepts a PerformanceCounter category name and counter name from the command line. It gets the InstanceDataCollectionCollection for the PerformanceCounterCategory. Then, if the PerformanceCounter exists, the example uses the Item property (referenced as an indexer) to obtain the associated InstanceDataCollection and displays the instance names from the collection.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft