Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

How We Can Make a windows application which shows Running Processes:

Author: DevASP
Download Source Code : 619_Getallprocess.zip

This article is about how you can make a windows application which shows all the processes running, which can also be viewed in windows task manager by pressing shortcut key "CTRL+ALT+DEL.

Steps you will do.

 

Open MS visual studio and create new Visual C# windows application.Set the following properties of the form.

 

Name = “Form1’

Text= “Running Process”

 

Drop a list box control and set its following properties.

 

Name = “LB_Processes”

Sorted = “True”

 

Now drop a text box control on the form and set its following properties.

 

Name = “TB_All_Processes”

ReadOnly = “True”

 

Drop two button controls on the form and set their following properties.

 

 

First button control

 

Name = “PB_Get’

Text = “Get”

 

 

Second button control

 

Name = “PB_Exit’

Text = “Exit”

 

 

Open the code window of form and import the following namespace.

 

using System.Diagnostics;

 

Write following code in the click event of the Get button.

 

this.LB_Processes.Items.Clear();

Process[] all_process = Process.GetProcesses();

foreach (Process x in all_process)

{

this.LB_Processes.Items.Add(x.ProcessName + " \t");

this.TB_All_Processes.Text = Convert.ToString(this.LB_Processes.Items.Count);

}

 

 

 

Finally write the following code in the click event of exit button to exit from the application.

 

this.Close();

 

Run your application and click the get button to get all the running process. The total number of running process will be shown in the text field and their list will be shown in the list box.

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< How Can We Get All Drives information in Form of Tree View in .NET 2.0.

Disclaimer - Privacy
© 2002-2017 DevASP.net