Renci.SshNet.ShellStream.WriteLine C# (CSharp) Method

WriteLine() public method

Writes the line to the shell.
If line is null, only the line terminator is written.
public WriteLine ( string line ) : void
line string The line to be written to the shell.
return void
        public void WriteLine(string line)
        {
            var commandText = string.Format("{0}{1}", line, "\r");
            Write(commandText);
        }

Usage Example

Beispiel #1
5
        static void Main(string[] args)
        {
            Console.WriteLine("fd");

            try
            {
                ssh = new SshClient("10.141.3.110", "root", "ismail");
                ssh.Connect();
                 //status = true;
                 //timer_enable();
            }
            //catch (Exception ex)
            // {
            //    Console.Write(ex.Message);
            //}

            catch { }

               if (true)
            try
            {
                stream = ssh.CreateShellStream("xterm", 80, 50, 1024, 1024, 1024);
                Thread.Sleep(100);
                stream.WriteLine("telnet localhost 6571");
                Thread.Sleep(100);
            }
            catch (Exception)
            {
                Console.WriteLine("hata");
            }

            Console.ReadKey();
        }
All Usage Examples Of Renci.SshNet.ShellStream::WriteLine