title: Get Process ID of Program Started with C# Process.Start
body: <p>Thanks in advance for all of your help!</p>
  
  <p>I am currently developing a program in C# 2010 that launches PLink (Putty) to create a SSH Tunnel. I am trying to make the program able to keep track of each tunnel that is open so a user may terminate those instances that are no longer needed. I am currently using System.Diagnostics.Process.Start to run PLink (currently Putty being used). I need to determine the PID of each plink program when it is launched so a user can terminate it at will.</p>
  
  <p>Question is how to do that and am I using the right .Net name space or is there something better?</p>
  
  <p>Code snippet:</p>
  
  <pre><code>private void btnSSHTest_Click(object sender, EventArgs e)
  {
      String puttyConString;
      puttyConString = "-ssh -P " + cboSSHVersion.SelectedText + " -" + txtSSHPort.Text + " -pw " + txtSSHPassword.Text + " " + txtSSHUsername.Text + "@" + txtSSHHostname.Text;
      Process.Start("C:\\Program Files (x86)\\Putty\\putty.exe", puttyConString);
  }
  </code></pre>