class Classe { private PerformanceCounter perf; ...
public Classe() { perf = new PerformanceCounter("Processus", "% Temps processeur", "TOTO.exe"); ...
perf.NextValue();
private void button1_Click(object sender, System.EventArgs e) { PerformanceCounter PC=new PerformanceCounter(); PC.CategoryName="Process"; PC.CounterName="Private Bytes"PC.InstanceName="Toto"; while (PC.NextValue() == 0) { textBox1.Text = PC.NextValue().ToString(); }
PC.CounterName="Private Bytes"PC.InstanceName="Toto";
PC.CounterName="Private Bytes"; PC.InstanceName="Toto";