title: Show all running applications in ListBox and kill them on button click in c#
body: <p>I want to collect processes in listbox like this:</p>
  
  <blockquote>
    <p>app.exe
    otherapp.exe</p>
  </blockquote>
  
  <p>but I just get:</p>
  
  <blockquote>
    <p>System.Diagnostics.Process(app.exe)
    System.Diagnostics.Process(otherapp.exe)</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>    private void Form1_Load(object sender, EventArgs e)
      {
          Process[] prs = (Process.GetProcesses());
  
          foreach (Process pr in prs)
          {
              listBox1.Items.Add(Convert.ToString(pr));
          }
      }
  
      private void button3_Click(object sender, EventArgs e)
      {
          Process[] prs = Process.GetProcesses();
  
          string item = Convert.ToString(listBox1.SelectedItem);
  
          //item.Kill();
      }
  </code></pre>