static void Main(string[] args)
{
System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcesses();
int i = 1;
foreach (System.Diagnostics.Process p in processes)
{
System.Console.WriteLine(i.ToString() + ": " + p.ToString());
i++;
}
System.Diagnostics.Process[] process = System.Diagnostics.Process.GetProcessesByName("EXCEL.EXE");
foreach (System.Diagnostics.Process p in process)
{
p.Kill();
}
System.Diagnostics.Process[] processes1 = System.Diagnostics.Process.GetProcesses();
int j = 1;
foreach (System.Diagnostics.Process p in processes1)
{
System.Console.WriteLine(j.ToString() + ": " + p.ToString());
j++;
}
Console.ReadLine();
}