Here is a code snippet in C# that does it. You need to import the namespace System.Diagnostics. The sample terminates an instance of notepad if it is running.
Process
[] arrProcesses = Process.GetProcessesByName("notepad"); if (arrProcesses.Length > 0) arrProcesses[0].Kill();
Close application
patel_mitesh
TMacPhail
Here is a code snippet in C# that does it. You need to import the namespace System.Diagnostics. The sample terminates an instance of notepad if it is running.
Process
[] arrProcesses = Process.GetProcessesByName("notepad");if (arrProcesses.Length > 0)
arrProcesses[0].Kill();
Regards,
Vikram