My English not very good,please excuse me!
I want look for system's processes,there is one error like this
:"processes performance counter is not enable!" why??
ÎÒÔÚÁоÙϵͳ½ø³ÌµÄʱºòÔõôÀÏÊDZ¨´í£¬Ëµ¡°½ø³ÌÐÔÄÜ¼Æ ÊýÆ÷ÒѽûÓã¬Òò´ËÎÞ·¨Ö´
ÐÐËù
ÇëÇóµÄ²Ù×÷¡£¡±£¬²é°ïÖú²é²»³öÀ´£¡£¡Çó¸÷λ´óϺָµãÖ¸ µãСµÜ~~£¬¾ßÌå³ÌÐòÈçÏÂ
£¡
THE CODE:
private void BottonStop_Click(object sender, System.EventArgs e)
{
try
{
Process[] My_Processes;
//System.Diagnostics.PerformanceCounter
My_Processes = Process.GetProcesses();
foreach (Process instance in My_Processes)
{
listBox1.Items.Add(instance.ProcessName.ToString() );
}
}
catch(System.InvalidOperationException aaa)
{
MessageBox.Show(aaa.ToString());
}
}