0

Hi
I want to create a c# program where i have to check processes which are currently running and close a particular of them can any one help me
Thanks.

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by bahed121
1
using System.IO;
using System.Diagnostics;
//name is the process name passed to the funciton
//public bool isProcRunning(String name)
public void isProcRunning(String name)

        {

            foreach (Process clsProcess in Process.GetProcesses())

            {

                if (clsProcess.ProcessName.Contains(name))

                {//return true;
 clsProcess.CloseMainWindow();
                }

            }
// return false;

        }
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.