visual studio 2010 - Get Process ID of Program Started with C# Process.Start -


Thank you in advance for all your help!

I am currently developing the program in C # 2010 to launch a clerk to create an SSH tunnel. I am making the program able to keep track of each tunnel which is open so that a user Ending the frequencies that are no longer necessary. I am currently using the system. Diagnostics Process. Clippers to start (currently using the confirmatory). I need to determine the PID of each crust program when it is launched so that a user can finish it.

The question is how to do it and I am using the right one. Is Net's name or location better?

Code snippet:

  Private zeros btnSSHTest_Click (Object Sender, EventArgs e) {String puttyConString; PuttyConString = "-ssh-P" + cboSSHVersion.SelectedText + "-" + + + txtSSHPort.Text + "-pw" + txtSSHPassword.Text + "" + + txtSSH u name. Text + "@" + txtSSHHostname.Text; process. Start ("C: \\ Program Files (x86) \\ Putty \\ putty.exe", puttyConString); }  

You can:

  Private Zero btnSSHTest_Click (Object Sender, EventArgs e) {string puttyConString; PuttyConString = "-ssh-P" + cboSSHVersion.SelectedText + "-" + + + txtSSHPort.Text + "-pw" + txtSSHPassword.Text + "" + + txtSSH u name. Text + "@" + txtSSHHostname.Text; Process Putty = Process. Start ("C: \ Program Files (x86) \\ Putty \\ Putty.exa", PuttyTconString); Int processId = putty.Id; }  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -