Process.StandardOutput returns same data repeatedly

  • Thread starter Thread starter Yash
  • Start date Start date
Y

Yash

In a VB .NET program, I am trying to read the standard output of an FTP
program. I am using a Process object and reading from its
StandardOutput property.
After doing a StandardOutput.ReadLine(), I do a
StandardOutput.DiscardBufferedData(). Yet, the next Readline returns
the same data that was read earlier. I have to read in a while loop to
reach the new output data.
What could be the problem?
Thanks
 
Hi Yash,

I use this for it, maybe it helps you to use that
\\\
Dim sr As IO.StreamReader = p.StandardOutput
Dim sb As New System.Text.StringBuilder("")
Dim input As Integer = sr.Read
Do Until input = -1
sb.Append(ChrW(input))
input = sr.Read
Loop
dim mystring = sb.toString
///

I hope this helps?

Cor
 
Back
Top