09-05-2010, 06:47 PM
I use this quite a bit, although you should trim your code down a bit; it's got a couple of useless lines in it (People won't understand what your Function.WriteTo method is) Also the random { at the start ;)
Code:
Process[] processes = Process.GetProcessesByName(TextBox1.Text);
foreach (Process process in processes)
{
process.Kill();
}