1. obtain the local string processName; // process name to int processID; // ID int threadNumber; // number of processes TimeSpan cpuTime; // CPU time long processMemory; // Number of memories 2. the framework structure to be implemented (add three menus and one listView). For details about the attribute settings of listView, refer to the application of the control in section C # above: add an event processing function for the three menus, add code: private void creation process ToolStripMenuItem_Click (object sender, EventArgs e) {OpenFileDialog ofDlg = new OpenFileDialog (); // build the Open File Dialog Box ofDlg. filter = "All Executables (*. exe) | *. exe "; // filter if (ofDlg. showDialog () = DialogResult. OK) {try {Process newprocess = Process. start (ofDlg. fileName); // select process} catch (Exception ex) {MessageBox. show (ex. toString () ;}} private void refresh list ToolStripMenuItem_Click (object sender, EventArgs e) {// display process information string processName; // process name is int processID; // ID int threadNumber; // process count TimeSpan cpuTime; // CPU time long processMemory; // Number of memory listView1.Items. clear (); // Clear the original content in the List View Process [] processes = Process. getProcesses (); // defines a dynamic array to obtain all processes in the current system. try {// Add each process project to the list for (int I = 0; I <processes. length; I ++) {processName = processes [I]. processName; processID = processes [I]. id; threadNumber = processes [I]. threads. count; // obtain the number of processes cpuTime = processes [I]. totalProcessorTime; processMemory = processes [I]. workingSet64; string [] subItems = {processName, processID. toString (), threadNumber. toString (), string. format ("{0: 00 }:{}", cpuTime. hours, cpuTime. minutes, cpuTime. seconds), string. format ("{0 :#,#,#} k", processMemory/1024)}; // insert a row of listView1.Items. insert (I, new ListViewItem (subItems) ;}} catch (System. exception ex) {MessageBox. show (ex. message) ;}} private void End Process ToolStripMenuItem_Click (object sender, EventArgs e) {if (listView1.SelectedItems. count> 0) {string str = listView1.SelectedItems [0]. subItems [1]. text; int processID = Int32.Parse (str); // obtain the ID of the selected project. // obtain the Process selectedProcess = Process based on the ID. getProcessById (processID); selectedProcess. kill (); // terminate the process }}