Bagikan melalui


PerformanceCounter.CounterName Properti

Definisi

Mendapatkan atau menetapkan nama penghitung kinerja yang terkait dengan instans ini 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

Nilai Properti

Nama penghitung, yang umumnya menjelaskan kuantitas yang dihitung. Nama ini ditampilkan dalam daftar penghitung snap MMC Performance Counter Manager dalam kotak dialog Tambahkan Penghitung.

Atribut

Pengecualian

Contoh

Contoh kode berikut menunjukkan cara mengatur CounterName properti ke nama penghitung umum.

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())

Keterangan

Anda bisa mendapatkan daftar penghitung yang sudah ada sebelumnya yang tersedia dari kotak dialog Tambahkan Penghitung Manajer Performa Windows.

Berlaku untuk