Hi,
My program is access the remote system's command prompt through C# program. I can do it. But problem is alignment of that output.
can any one give idea to align that output ?.
here is my code......................
try
{
SshShell ssh1 = new SshShell(host,user,pass);
SshStream ssh = new SshStream(host, user, pass);
Console.WriteLine("------Connecting...");
ssh1.Connect();
Console.Write("OK");
Console.WriteLine();
//ssh.Prompt ="$";
ssh1.RemoveTerminalEmulationCharacters = true;
Console.Write(ssh1.Expect("$"));
//ssh1.Expect("$");
while (true)
{
Console.Write("Ent the cmd:");
string command = Console.ReadLine();
if (command.ToLower().Equals("exit"))
break;
ssh1.WriteLine(command);
string out1 = ssh1.Expect(">");
out1 = out1.Replace(" ", "\n ");
out1 = "\n" + out1;
Console.WriteLine(out1);
//Console.WriteLine(ssh1.Expect(">"));
}
ssh1.Close();
ssh.Close();
Console.WriteLine("Connection closed.");
}