you need to get the whole process in an array of processes so that we get a process that is running
Process []GetPArry = Process.GetProcesses();
foreach(Process testProcess in GetPArry)
{
string ProcessName = testProcess .ProcessName;
ProcessName = ProcessName .ToLower();
if (ProcessName.CompareTo("winword") == 0)
testProcess.Kill();
}
here winword is a different process, or you can say that the application on which we are going to kill
naval source
share