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

ReadLine() public method

Reads the line from the shell. If line is not available it will block the execution and will wait for new line.
public ReadLine ( ) : string
return string
        public string ReadLine()
        {
            return ReadLine(TimeSpan.Zero);
        }

Same methods

ShellStream::ReadLine ( System.TimeSpan timeout ) : string

Usage Example

Exemplo n.º 1
0
 /// <summary>
 /// Read the output until we see a particular line.
 /// </summary>
 /// <param name="_stream"></param>
 /// <param name="p"></param>
 private void DumpTillFind(ShellStream stream, string matchText, Action<string> ongo = null)
 {
     while (true)
     {
         var l = stream.ReadLine();
         if (l == null)
         {
             Thread.Sleep(100);
         }
         else
         {
             if (l.Contains(matchText))
             {
                 return;
             }
             else
             {
                 if (ongo != null)
                 {
                     ongo(l);
                 }
             }
         }
     }
 }
All Usage Examples Of Renci.SshNet.ShellStream::ReadLine