using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Diagnostics;
namespace Windowsapplication27 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void get_Click(object sender, EventArgs e) { listBox1.Items.Clear(); //clear all the listbox information Process[] myprocesses = System.Diagnostics.Process.GetProcesses(); Process process; for (int i = 0; i < myprocesses.Length - 1; i++) { process = myprocesses[i]; listBox1.Items.Add(process.ProcessName); } }