C# continous program checking
<p>I want to create a program, which continuously checking the program's list, and when there is a what i specified it's closing. I want while the program is running the specified program close. But now that still not close.</p>

<p>I used this code: </p>

<pre><code>using System;
using System.Diagnostics;

class Program
{
    public static void Main()
    {
        Process[] prs = Process.GetProcesses();
        while (true)
        {
            foreach (Process pr in prs)
            {
                if (pr.ProcessName == "GameRanger")
                {

                    pr.Kill();

                }
            }
        }
    }
}
</code></pre>
