0

I want to ask if it is possible to send CTRL + C over Renci SSH.NET ?

At the moment I execute my commands over a shellstream, but it stops because I have to abort the ongoing program.

So far I tried to use in ASCII converted values but then I get an syntax error in VS.

try
{
    SshClient ssh = new SshClient(ip, username, password);
    ssh.Connect();
    try
    {
        Console.WriteLine("Verbindung aufgebaut!");
        var stream = ssh.CreateShellStream("xterm", 80, 50, 1024, 1024, 1024);
        System.Threading.Thread.Sleep(500);
        stream.WriteLine("su");
        System.Threading.Thread.Sleep(500);
        stream.WriteLine("root");
        stream.WriteLine("***************");
        Console.Write("Test wird durchgeführt! Zum beenden bitte Gerät neustarten!");
    }
    catch
    {
        Console.WriteLine("Ein Fehler ist aufgetreten! Bitte überprüfen!");
        Console.ReadKey();
    }
}
catch
{
    Console.WriteLine("Kundensoftware vorhanden! Bitte Software neu aufspielen!");
    Console.ReadKey();
}
MindSwipe
  • 7,193
  • 24
  • 47
Kai
  • 19
  • 5

0 Answers0