Sorry if i've overlooked something silly...
using (var client = new SshClient("ipaddress", "USER", "PASSWORD"))
{
client.Connect();
string xnatCli = @"XNATRestClient -host http://localhost:8080/xnat/ -u admin -p administrator -m PUT -remote ""/data/archive/projects/prj005/subjects/test12/experiments/visit12?xnat:petSessionData/date=12/12/12" + "\"";
//string list = "ls -lrt";
var cmd = client.RunCommand(xnatCli);
cmd.Execute();
var outputQuery = cmd.Result;
Console.Write(outputQuery);
Console.Read();
}
Dear developers..I'm hoping that someone can help me..I'm quite stuck for ideas to why this would not work. I've tried simple commands as illustrated above ls -lrt in RunCommand(). It worked fine used putty or ssh'ing from another linux machine with the command(xnatCli) works fine. However will not work in this code instance. String length limitation on ssh.net.RunCommand() maybe? Am i doing something silly?
try using StringBuilder instead of string:
Hope it helps.