This is a very simple way to kill an application by code under Windows.

Don’t forget to add System.Diagnostics in the Using section.

public void KillApp(string appName)
{
    try
    {
        foreach (Process proc in Process.GetProcessesByName(appName))
            proc.Kill();
    }
    catch (Exception ex)
    {
        //TODO...
    }
}

Enjoy!