Afternoon
I have a little problem with the SharpSSH library for .Net (see http://www.tamirgal.com/blog/page/SharpSSH.aspx )
SshStream ssh = new SshStream("some ip address", "some username", "some password");
ssh.Prompt = "\n";
ssh.RemoveTerminalEmulationCharacters = true;
ssh.Write("ssh some ip address");
ssh.ReadResponse();
ssh.Write("lss /mnt/sata[1-4]");
ssh.ReadResponse();
while (ssh.CanRead)
{
Console.WriteLine(ssh.ReadResponse());
}
ssh.Close();
As you can see, this is pretty straight forward.
However, when the while loop is turned on, it will not exit the loop when everything is printed on the console, and there is nothing more to read.
In any case, can I manually force it to break when nothing else is read?
Cheers ric
source
share