var ssh = new SshClient("ip", "user", "pass");
var input = new MemoryStream(Encoding.ASCII.GetBytes("exit\r\n"));
var shell = ssh.CreateShell(input, Console.Out, Console.Out, "xterm", 80, 24, 800, 600, "");
shell.Stopped += delegate(object sender, EventArgs e)
{
Console.WriteLine("\nDisconnected...");
};
shell.Start();
Thread.Sleep(1000 * 1000);
shell.Stop();
Run Code Online (Sandbox Code Playgroud)
这行错误:
var shell = ssh.CreateShell(input, Console.Out, Console.Out, "xterm", 80, 24, 800, 600, "");
Run Code Online (Sandbox Code Playgroud)
错误:错误3参数2:无法从'System.IO.TextWriter'转换为'System.IO.Stream'D:\ applications area\test\ConsoleApplication1\ConsoleApplication1\Program.cs 19 48 ConsoleApplication1
错误4参数3:无法从'System.IO.TextWriter'转换为'System.IO.Stream'D:\ applications area\test\ConsoleApplication1\ConsoleApplication1\Program.cs 19 61 ConsoleApplication1
任何解决方案
c# ×1