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

New Post: Running commands not returning results

$
0
0
Looks good in a simple test program:
            var sshCommand = client.CreateCommand("pwd");
            var asynch = sshCommand.BeginExecute();
            var reader = new StreamReader(sshCommand.OutputStream);
            var errreader = new StreamReader(sshCommand.ExtendedOutputStream);

            while (!asynch.IsCompleted)
            {
                var result = reader.ReadToEnd();
                var error = errreader.ReadToEnd();
                if (string.IsNullOrEmpty(result) && string.IsNullOrEmpty(error))
                    continue;
                Console.WriteLine("StdErr: " + error);
                Console.WriteLine("StdOut: " + result);
            }
=>
StdErr:
StdOut: /root

Viewing all articles
Browse latest Browse all 1729

Trending Articles



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