Kill process by current user
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/426573/how-do-you-kill-a-process-for-a-particular-user-in-net-c">How do you kill a process for a particular user in .NET (C#)?</a>  </p>
</blockquote>



<p>In my updater application i need to kill the main program before updating it.</p>

<p>Im using code to kill the process within the updater application, but it kills all processes with that name and therefore it kills the process for other users on the same machine. Is there some way to only kill the process for the current user?</p>

<p>This is my code so far:</p>

<pre><code>        foreach (System.Diagnostics.Process myProc in System.Diagnostics.Process.GetProcesses())
        {
            if (myProc.ProcessName == "ProgramName")
            {
                myProc.Kill();
            }
        }
</code></pre>
