close process c# code example
Example 1: stop process c#
Process[] workers = Process.GetProcessesByName("worker")
foreach (Process worker in workers)
{
worker.Kill();
worker.WaitForExit();
worker.Dispose();
}
Example 2: c# how to close application
Environment.Exit(0);