C#中打开任务管理器

 1 using System;
 2 using System.Collections.Generic;
 3 using System.ComponentModel;
 4 using System.Data;
 5 using System.Drawing;
 6 using System.Linq;
 7 using System.Text;
 8 using System.Threading.Tasks;
 9 using System.Diagnostics;
10 using System.Windows.Forms;
11 
12 namespace WindowsFormsApplication1
13 {
14     public partial class Form1 : Form
15     {
16         public Form1()
17         {
18             InitializeComponent();
19         }
20 
21     private void process1_Exited(object sender, EventArgs e)
22         {
23            
24         }
25 
26         private void button1_Click(object sender, EventArgs e)
27         {
28          process1.StartInfo.FileName=@"C:\WINDOWS\system32\taskmgr.exe";
29             process1.Start();
30         }
31     }
32 }

首先创建一个form窗体然后添加一个窗体,添加一个按钮,一个process控件,双击按钮在代码上添加代码。

以上点击一个按钮就可以打开任务管理器。

posted @ 2015-10-07 21:58  坚强的芒果  阅读(1227)  评论(0编辑  收藏  举报