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));
} } } }
Windows Foms App6|ID: 21796
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started