Maintain conversation

Jun 10, 2015 at 7:04 PM
Edited Jun 11, 2015 at 12:38 PM
All, I am looking to persist a conversation with a remote server.

What i am doing is connecting to a host, sending a command like change directory... to some directory besides root. Store the results value off as a global.

Then i am sending another command via RunCommand() to check the current directory...

What is happening is, i am getting the root directory, not the directory i just changed to in the initial run command.

How can i maintain an indefinite conversation with the remote server and have it persist state?


*** to clarify further, i have no issue opening and logging in to a server, what i am looking to do is open a terminal and send commands without losing the present state. If i change a directory when i send the next command i would expect to be at the directory i just changed to.
Jun 11, 2015 at 5:19 PM
after connection, you have to use a sshclient.shellstream for sendng commands & receiving responses
take a look at http://blog.atcp.us/2013/11/10/talking-to-cisco-routers-switches-firewalls-with-renci-sshnet/
Jun 25, 2015 at 7:07 PM
Thanks for the reply this link snowed me i'm a afraid, i am a native c# user, do you have any simplified examples?