---
title: "Check Running Process in CSharp .NET"  
description: "/* Style Definitions */   table.MsoNormalTable  	{mso-style-name:\"Table Normal\";  	mso-tstyle-rowband-size:0;  	mso-tstyle-colband-size:0;  	mso-st"  
author: "Anonymous User"  
published: 2010-07-30  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/49/check-running-process-in-csharp-dot-net  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# Check Running Process in CSharp .NET

Process Check application shows the currently running processes. You can also end running process.\

##### Form Details

![Check Running Process in CSharp .NET](https://www.mindstick.com/mindstickarticle/cdf9b867-5205-4a51-8de0-a93000d1e4d2/images/8b3442e4-1b51-4f37-85ab-647a5989c7f4.png)

##### \

##### \

##### \

##### \

##### \

##### \

##### \

##### \

##### \

##### Objects name

Form:frmProcess

Select list box: lstProcess

Process currently running list box: lstAll

Check button: btnCheck

End Process button: btnKill

Check All button: btnCheckAll

Exit button: btnExit

##### Form code with Explanation

```
//Code for btnExit click event.      private void btnExit_Click(object sender, EventArgs e)        {//Close Application            this.Close();        } //Code for btnCheck click event. This will check for the selected process in the select list box(lstProcess)        private void btnCheck_Click(object sender, EventArgs e)        {            Boolean found = false; //store the status for record found or not            string selItem = Convert.ToString(lstProcess.SelectedItem);//storing the selected item from the list box in selItem            selItem = selItem.ToUpper(); //converting value of selItem toupper case.System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcesses();//assigning running  process in array// loop to check all running process            for (int i = 0; i < myProcesses.Length; i++)            {   //checking whether selected process is running or not. If running then value of found will be assigned //‘true’                             if (selItem == myProcesses[i].ProcessName.ToUpper())                    found = true;            }            if (found)                MessageBox.Show(selItem + " is running !!!");            else                MessageBox.Show(selItem + " is not running !!!");                    } //code for button btnCheckAll. This will show all the running processes//in list box ‘lstAll’        private void btnCheckAll_Click(object sender, EventArgs e)        {            lstAll.Items.Clear(); //this will clear the list box.System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcesses();      //fetching all running processes and storing in myProcess array.//loop for adding all running process in list box.            for (int i = 0; i < myProcesses.Length; i++)                lstAll.Items.Add(myProcesses[i].ProcessName);slblProcess.Text = "No. of Processes running: "+myProcesses.Length;      //displaying no. of running processes in status bar.            btnKill.Enabled = true;            lstAll.SetSelected(0, true);        }         private void frmProcess_Load(object sender, EventArgs e)        {            this.CenterToScreen();            lstProcess.SetSelected(0, true);        }  //code for btnKill click event.        private void btnKill_Click(object sender, EventArgs e)        {                        string selItem = Convert.ToString(lstAll.SelectedItem);            string process;                        selItem = selItem.ToUpper();System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcesses();//loop to check for running process selecter from lstAll list box.            for (int i = 0; i < myProcesses.Length; i++)            {                process = myProcesses[i].ProcessName;                process = process.ToUpper();                try                {                    if (selItem == process)                        myProcesses[i].Kill();//killing process selected from lstAll list box                }                catch (Exception ex)                {                    MessageBox.Show(ex.Message);                }            }                    }
```

##### Screen shots

![Check Running Process in CSharp .NET](https://www.mindstick.com/mindstickarticle/cdf9b867-5205-4a51-8de0-a93000d1e4d2/images/6a7aa17f-eeda-4eba-a791-5a9710dd61e8.png)

![Check Running Process in CSharp .NET](https://www.mindstick.com/mindstickarticle/cdf9b867-5205-4a51-8de0-a93000d1e4d2/images/ba3190e4-dcf3-43e1-b905-0b133936b4a9.png)

\

---

Original Source: https://www.mindstick.com/articles/49/check-running-process-in-csharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
