Compartir a través de


PerformanceCounter.CounterName Propiedad

Definición

Obtiene o establece el nombre del contador de rendimiento asociado a esta instancia de PerformanceCounter.

public:
 property System::String ^ CounterName { System::String ^ get(); void set(System::String ^ value); };
public string CounterName { get; set; }
[System.ComponentModel.TypeConverter("System.Diagnostics.Design.CounterNameConverter, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public string CounterName { get; set; }
[System.ComponentModel.TypeConverter("System.Diagnostics.Design.CounterNameConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public string CounterName { get; set; }
[System.ComponentModel.SettingsBindable(true)]
[System.ComponentModel.TypeConverter("System.Diagnostics.Design.CounterNameConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public string CounterName { get; set; }
member this.CounterName : string with get, set
[<System.ComponentModel.TypeConverter("System.Diagnostics.Design.CounterNameConverter, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]
member this.CounterName : string with get, set
[<System.ComponentModel.TypeConverter("System.Diagnostics.Design.CounterNameConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]
member this.CounterName : string with get, set
[<System.ComponentModel.SettingsBindable(true)>]
[<System.ComponentModel.TypeConverter("System.Diagnostics.Design.CounterNameConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]
member this.CounterName : string with get, set
Public Property CounterName As String

Valor de propiedad

Nombre del contador, que normalmente describe la cantidad que se cuenta. Este nombre se muestra en la lista de contadores del cuadro de diálogo Add Counters del complemento Administrador de contadores de rendimiento de MMC (Microsoft Management Console).

Atributos

Excepciones

El valor de CounterName es null.

Ejemplos

En el ejemplo de código siguiente se muestra cómo establecer la CounterName propiedad en un nombre de contador típico.

PerformanceCounter^ PC = gcnew PerformanceCounter;
PC->CategoryName = "Process";
PC->CounterName = "Private Bytes";
PC->InstanceName = "Explorer";
MessageBox::Show( PC->NextValue().ToString() );
PerformanceCounter performanceCounter = new PerformanceCounter();
performanceCounter.CategoryName = "Process";
performanceCounter.CounterName = "Private Bytes";
performanceCounter.InstanceName = "Explorer";
MessageBox.Show(performanceCounter.NextValue().ToString());
Dim PC As New PerformanceCounter()
PC.CategoryName = "Process"
PC.CounterName = "Private Bytes"
PC.InstanceName = "Explorer"
MessageBox.Show(PC.NextValue().ToString())

Comentarios

Puede obtener una lista de contadores preexistentes disponibles en el cuadro de diálogo Agregar contadores del Administrador de rendimiento de Windows.

Se aplica a