Question: I'm using c# forms this is supposed to return the process that's going on in the pc but for some reason, it only returns the

I'm using c# forms this is supposed to return the process that's going on in the pc but for some reason, it only returns the program that's running and nothing else. I found one that would work but the issue is that it's not really showing the change in real-time if that makes sense. I'm trying to make this one show when a process is running and then if I close one it will show that it was closed on the list

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Diagnostics; using System.Management; using System.Security.Principal; using System.Threading; using System.Windows.Forms;

namespace WindowsFormsApp6 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

private void Form1_Load(object sender, EventArgs e) { { Process currentProcess = Process.GetCurrentProcess(); listBox1.Items.Add(string.Format(@"{0} | ID: {1}", currentProcess.ProcessName, currentProcess.Id));

} } } }

I'm using c# forms this is supposed to return the process that's

Windows Foms App6|ID: 21796

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!