这只是一个列子 并没有其他操作 可以对进行匹配 比如进程名为 QQ 然后对数据库操作 查找qq进程在实体中的名字为 腾讯qq 并显示 等等、、、 private void Process_Load(object sender, EventArgs e) { dataGridView1.Columns.Clear(); dataGridView1.Columns.Add("Id", "句柄"); dataGridView1.Columns.Add("Name", "进程名"); dataGridView1.Columns.Add("StartTime", "启动时间"); dataGridView1.Columns.Add("EndTime", "结束时间"); dataGridView1.Columns.Add("HandleCount", "打开的进程数量"); dataGridView1.Columns.Add("MachineName", "打开的进程数量"); dataGridView1.Columns.Add("StandardOutput", "打开的进程数量"); int index = 0; foreach (Process proInfo in Process.GetProcesses()) { index = dataGridView1.Rows.Add(); dataGridView1["Id", index].Value = proInfo.Id; dataGridView1["Name", index].Value = proInfo.ProcessName; try { dataGridView1["EndTime", index].Value = proInfo.ExitTime.ToShortTimeString(); } catch (Exception ex) { dataGridView1["EndTime", index].Value = "--"; } dataGridView1["HandleCount", index].Value = proInfo.HandleCount; dataGridView1["MachineName", index].Value = proInfo.MachineName; try { dataGridView1["StandardOutput", index].Value = proInfo.StandardOutput.ReadToEnd(); } catch (Exception ex) { dataGridView1["StandardOutput", index].Value = "--"; } try { dataGridView1["StartTime", index].Value = proInfo.StartTime.ToShortTimeString(); } catch (Exception ex) { dataGridView1["StartTime", index].Value = "--"; } } }