Problem reading from the StandarOutput from ftp.exe. Possible System.Diagnostics.Process Framework b
- by SoMoS
Hello, I was trying some stuff executing console applications when I found this problem handling the I/O of the ftp.exe command that everybody has into the computer. Just try this code:
m_process = New Diagnostics.Process()
m_process.StartInfo.FileName = "ftp.exe"
m_process.StartInfo.CreateNoWindow = True
m_process.StartInfo.RedirectStandardInput = True
m_process.StartInfo.RedirectStandardOutput = True
m_process.StartInfo.UseShellExecute = False
m_process.Start()
m_process.StandardInput.AutoFlush = True
m_process.StandardInput.WriteLine("help")
MsgBox(m_process.StandardOutput.ReadLine())
MsgBox(m_process.StandardOutput.ReadLine())
MsgBox(m_process.StandardOutput.ReadLine())
MsgBox(m_process.StandardOutput.ReadLine())
This should show you the text that ftp sends you when you do that from the command line:
Los comandos se pueden abreviar. Comandos:
! delete literal prompt send
? debug ls put status
append dir mdelete pwd trace
ascii disconnect mdir quit type
bell get mget quote user
binary glob mkdir recv verbose
bye hash mls remotehelp
cd help mput rename
close lcd open rmdir
Instead of that I'm getting the first line and 3 more with garbage, after that the call to ReadLine block like if there was no data available.
Any hints about that?