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.

InstanceDataCollection::Item Property (String^)

 

Gets the instance data associated with this counter. This is typically a set of raw counter values.

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

public:
property InstanceData^ default[
	String^ instanceName
] {
	InstanceData^ get(String^ instanceName);
}

Parameters

instanceName
Type: System::String^

The name of the performance counter category instance, or an empty string ("") if the category contains a single instance.

Property Value

Type: System.Diagnostics::InstanceData^

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

Exception Condition
ArgumentNullException

The instanceName parameter is null.

The instanceName parameter is case-insensitive.

The following code example accepts a PerformanceCounter category name, counter name, and instance name from the command line. It gets the InstanceDataCollectionCollection for the category, which is a collection of InstanceDataCollection objects. From that it gets the particular InstanceDataCollection for the specified counter. Then, if the instance exists, the example uses the Item property (referenced as an indexer) to obtain the associated InstanceData object.

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