Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: RunCommand for sub processes (Mongo)?

$
0
0
Hey guys,

I'm trying to use client.RunCommand to pass a series of commands to a server instance of MongoDB. I am connecting to the server correctly using SSH... but when I try to run the command to launch Mongo -- it begins its "subprocess".

Meaning, I'm no longer able to pass any more commands using RunCommand.

This is my code right now:
            // Connect through SSH Client
            using (var client = new SshClient(con))
            {
                client.Connect();
                client.
                var cmd = client.RunCommand("ls"); 
                var output = cmd.Result; // Works
                MessageBox.Show(output.ToString()); // Works

                ////// Connect to mongoDB database
                var cmdMongo = client.RunCommand("mongo");

                var cmdData = client.RunCommand("show dbs");
                var outputData = cmdData.Result;
                MessageBox.Show(cmdData.ToString()); // Does not work. Program hangs.
            }
http://www.evernote.com/l/ADrQlyTZ6sBMFLyPIvZnsJzaIm_4EOk-_Pk/

Any suggestions?

Unfortunately, there isn't a Mongo driver that can upload with SSH... so I really need this to work.

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>