Прочетете на английски Редактиране

Споделяне чрез


CounterSetInstanceCounterDataSet.Item[] Property

Definition

Accesses a counter value in the collection.

Overloads

Item[Int32]

Accesses a counter value in the collection by using the specified counter identifier.

Item[String]

Accesses a counter value in the collection by using the specified counter name.

Item[Int32]

Source:
CounterSetInstanceCounterDataSet.cs
Source:
CounterSetInstanceCounterDataSet.cs
Source:
CounterSetInstanceCounterDataSet.cs
Source:
CounterSetInstanceCounterDataSet.cs
Source:
CounterSetInstanceCounterDataSet.cs
Source:
CounterSetInstanceCounterDataSet.cs

Accesses a counter value in the collection by using the specified counter identifier.

C#
public System.Diagnostics.PerformanceData.CounterData this[int counterId] { get; }

Parameters

counterId
Int32

Identifier of the counter. This is the identifier you used when you added the counter to the counter set.

Property Value

The counter data.

Remarks

Implemented as an indexer in C#.

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Item[String]

Source:
CounterSetInstanceCounterDataSet.cs
Source:
CounterSetInstanceCounterDataSet.cs
Source:
CounterSetInstanceCounterDataSet.cs
Source:
CounterSetInstanceCounterDataSet.cs
Source:
CounterSetInstanceCounterDataSet.cs
Source:
CounterSetInstanceCounterDataSet.cs

Accesses a counter value in the collection by using the specified counter name.

C#
public System.Diagnostics.PerformanceData.CounterData this[string counterName] { get; }

Parameters

counterName
String

Name of the counter. This is the name that you used when you added the counter to the counter set.

Property Value

The counter data.

Remarks

Implemented as an indexer in C#.

To use this overload, you must use the CounterSet.AddCounter(Int32, CounterType, String) method to add the counter to the counter set.

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10