This project is read-only.

How to get command result which contains multiple lines...

Jun 2, 2014 at 3:28 PM
Edited Jun 2, 2014 at 3:29 PM
        pcinfo = new PasswordConnectionInfo(host, username, password);
        sftpclnt = new SftpClient(pcinfo);
        clnt = new SshClient(pcinfo);
        clnt.Connect();
        cmd1 = clnt.RunCommand(command2);
        Console.WriteLine(cmd1.Result);
        clnt.Disconnect();

In cmd1.result i can able to get 1st line of the output. but in actual output there 25-60 lines of output depending on scripts...
Jul 17, 2014 at 3:39 PM
You could use an array..

String[] myArray = cmd1.Result.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);

This will split the array based on carriage returns and new lines etc