Unable to show result if it has more than a line.

May 23, 2013 at 2:03 PM
Edited May 23, 2013 at 2:05 PM
Hi,

First of all thanks for developing such a great library for SSH.

I am facing a problem whereby I am not able to show the result if I execute command such as "ls", which will return result with more than a line. The result would be blank even though the ExitStatus is 0.
However, it works perfectly if the command (i.e. "pwd" or "date") only returns one line.

Below is the code snippet which I am using currently:
using (SshClient client = new SshClient("host", "username", "password"))
{
  client.Connect();

  SshCommand cmd = client.CreateCommand("ls"); //works perfectly if substitutes "ls" with "pwd" or "date" which will only return result with one line.

  cmd.Execute();

  string result = cmd.Result;
  Console.WriteLine(result);

  client.Disconnect();
}
I would very appreciate if anyone of you could enlighten me so that the problem of displaying multiple line of result could be solved.

Thanks in advance. :)