Use
Application.Exit()
if you are calling from inside your application.
Process thisProc = null;
string processName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
foreach (Process openedProcesses in Process.GetProcesses())
{
if (openedProcesses.ProcessName.ToLower().Contains(processName.ToLower()))
{
thisProc = openedProcesses;
thisProc.Kill();
}
}