Just in case you wanted to create something to kill a process, I have this little bit:
using System; using System.Diagnostics; Action<Process> killProcess = currentProcess => currentProcess.Kill(); Process[] processes; String processToKill; processToKill = "WAR"; processes = Process.GetProcesses(); processes.Select(currentProcess => currentProcess.ProcessName == processToKill) .ToList() .ForEach(killProcess);
I originally intended this as a service that would kill processes that were running on a specific day. IE To stop myself from playing games during the week. Problem was finding a way to stop me from killing the service. Now you can set a service to disallowing stopping it. The idea being that I would have another program that would stop it only if a password was enter correctly. (A certain woman would have this password) Trouble is, I can just open up the task manager and kill the process. Now I have to rely on self control. WHICH IS THE REASON WHY I WANTED THIS IN THE FIRST PLACE.