Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is a c# program I'm having an issue with trying to display a listbox that shows the background process. the first image shows that

this is a c# program I'm having an issue with trying to display a listbox that shows the background process.

the first image shows that it has an issue with not having a main. so in the snd image, I put one in and try to run the program nothing happens I'm at a loss on how to fix this

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

1 Form1.cs + x Program.cs Form1.cs (Design) C# Windows FormsApp2 * WindowsFormsApp2.Form1 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.Windows.Forms; 10 using System.Diagnostics; 11 12 13 namespace WindowsFormsApp2 14 { 2 references 15 public partial class Form1 : Form 16 O references 17 public Form1() 18 19 InitializeComponent(); 20 21 references 22 private void Form1_Load(Object sender, EventArgs e) 23 24 Process[] processList = Process.GetProcesses(); 25 foreach (Process process in processList) 27 28 listBox1. Visible = true; 29 listBox1.Items.Add(string.Format(@"{@} | ID: {1} | Status {2} | Memory (private working set in Bytes) {3}", 30 process.ProcessName, process.Id, process. Responding, process. PrivateMemorySize64)); 32 Console.ReadLine(); 33 36 Code Description CS5001 Program does not contain a static 'Main' method suitable for an entry point Project WindowsFormsApp2 File CSC Line Suppression State 1 Active Form1_Load(object sender, EventArgs e) Form1.cs + X Program.cs Form1.cs (Design) C# WindowsFormsApp2 WindowsFormsApp2.Form1 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing: using System.Linq; using System.Text; 8 using System.Threading.Tasks; 9 using System.Windows.Forms; 10 using System.Diagnostics; 11 12 13 namespace Windows FormsApp2 14 { 2 references 15 public partial class Form1 : Form 16 O references 17 public Form1() 18 19 InitializeComponent(); 20 } O references 21 static void Main(string[] args) { } O references 22 private void Form1_Load(Object sender, EventArgs e) 23 24 Process[] processList = Process.GetProcesses(); 25 26 foreach (Process process in processList) 27 { 28 listBox1.Visible = true; 29 listBox1.Items.Add(string.Format(@"{@} | ID: {1} | Status {2} | Memory (private working set in Bytes) {3}", 6 7 8 sehu8s n89828% 9B 31 32 process.ProcessName, process.Id, process. Responding, process. PrivateMemorySize64)); Console.ReadLine(); 34 35 No issues found Ln: 30 Ch: 1 CRLF Output IX Show output from: Debug 'WindowsFormsApp2.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0_b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger opt: 'WindowsFormsApp2.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\halod\source epos\WindowsFormsApp2\WindowsFormsApp2\bin\Debug\WindowsFormsApp2.exe'. Symbols loaded. 'Windows FormsApp2.exe' (CLR v4.0.30319: WindowsFormsApp2.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0_b77a5c561934e089\System.Windows.Forms.dll'. Skipped loading symbols. Module 'WindowsFormsApp2.exe' (CLR v4.0.30319: WindowsFormsApp2.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.@_b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger 'WindowsFormsApp2.exe' (CLR v4.0.30319: Windows FormsApp2.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.@_b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized The program '[13360] WindowsFormsApp2.exe' has exited with code @ (exo). 1 Form1.cs + x Program.cs Form1.cs (Design) C# Windows FormsApp2 * WindowsFormsApp2.Form1 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.Windows.Forms; 10 using System.Diagnostics; 11 12 13 namespace WindowsFormsApp2 14 { 2 references 15 public partial class Form1 : Form 16 O references 17 public Form1() 18 19 InitializeComponent(); 20 21 references 22 private void Form1_Load(Object sender, EventArgs e) 23 24 Process[] processList = Process.GetProcesses(); 25 foreach (Process process in processList) 27 28 listBox1. Visible = true; 29 listBox1.Items.Add(string.Format(@"{@} | ID: {1} | Status {2} | Memory (private working set in Bytes) {3}", 30 process.ProcessName, process.Id, process. Responding, process. PrivateMemorySize64)); 32 Console.ReadLine(); 33 36 Code Description CS5001 Program does not contain a static 'Main' method suitable for an entry point Project WindowsFormsApp2 File CSC Line Suppression State 1 Active Form1_Load(object sender, EventArgs e) Form1.cs + X Program.cs Form1.cs (Design) C# WindowsFormsApp2 WindowsFormsApp2.Form1 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing: using System.Linq; using System.Text; 8 using System.Threading.Tasks; 9 using System.Windows.Forms; 10 using System.Diagnostics; 11 12 13 namespace Windows FormsApp2 14 { 2 references 15 public partial class Form1 : Form 16 O references 17 public Form1() 18 19 InitializeComponent(); 20 } O references 21 static void Main(string[] args) { } O references 22 private void Form1_Load(Object sender, EventArgs e) 23 24 Process[] processList = Process.GetProcesses(); 25 26 foreach (Process process in processList) 27 { 28 listBox1.Visible = true; 29 listBox1.Items.Add(string.Format(@"{@} | ID: {1} | Status {2} | Memory (private working set in Bytes) {3}", 6 7 8 sehu8s n89828% 9B 31 32 process.ProcessName, process.Id, process. Responding, process. PrivateMemorySize64)); Console.ReadLine(); 34 35 No issues found Ln: 30 Ch: 1 CRLF Output IX Show output from: Debug 'WindowsFormsApp2.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0_b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger opt: 'WindowsFormsApp2.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\halod\source epos\WindowsFormsApp2\WindowsFormsApp2\bin\Debug\WindowsFormsApp2.exe'. Symbols loaded. 'Windows FormsApp2.exe' (CLR v4.0.30319: WindowsFormsApp2.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0_b77a5c561934e089\System.Windows.Forms.dll'. Skipped loading symbols. Module 'WindowsFormsApp2.exe' (CLR v4.0.30319: WindowsFormsApp2.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.@_b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger 'WindowsFormsApp2.exe' (CLR v4.0.30319: Windows FormsApp2.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.@_b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized The program '[13360] WindowsFormsApp2.exe' has exited with code @ (exo)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Neo4j Data Modeling

Authors: Steve Hoberman ,David Fauth

1st Edition

1634621913, 978-1634621915

More Books

Students also viewed these Databases questions

Question

1. Describe the types of power that effective leaders employ

Answered: 1 week ago