2
Answers

how to get processes belonging to Win32 in c#

Rashmi kaneri

Rashmi kaneri

8y
259
1
My requirement is to find the processes belonging win32 and kill them.
i have written code as given below but it gives all the processes including Win64.
i searched many sites for the same but could not get what i needed.
can someone help me on this......
 
Process[] ListofProcess = Process.GetProcesses();
foreach (Win32_Process prossesitem in ListofProcess)
{
if ((Equals(prossesitem, strProcessName) == true))
{
prossesitem.Kill();
}
}
Answers (2)