StandardOutput of FTP

Y

Yash

If on the command line, I type ftp <machine> > C:\temp\ftp.out, and
then keep typing FTP commands, the output of the FTP session correctly
goes to the C:\temp\ftp.out file.
This output contains:
ftp> Connected to lille.
open lille
220 lille.intranet.pspl.co.in FTP server (Version 1.1.214.8 Fri Apr 20
07:27:42 GMT 2001) ready.
ftp> user myname mypass
331 Password required for myname.
230 User myname logged in.
ftp> put C:\a.txt
200 PORT command successful.
150 Opening ASCII mode data connection for a.txt.
226 Transfer complete.
ftp: 26228 bytes sent in 0.00Seconds 26228000.00Kbytes/sec.
ftp> bye
221 Goodbye.


Note that the ftp> prompt, and status numbers ( 220, 226, etc.) have
been sent to the standard output.

We want to run an FTP session from a VB .NET program. We redirected
the StandardInput/Output/Error of the Process object that invokes the
FTP program, and also set UseShellExecute to False.
I notice that commands sent to the processes StandardInput are
properly getting executed. However, if I read the StandardOutput, the
status messages do not get read. Nor does the command prompt.
Only messages like
ftp: 26228 bytes sent in 0.00Seconds 26228000.00Kbytes/sec. or
Connected to lille
etc. get read.

What can I do to make sure all messages can be read from the
StandardOutput?

Thanks
 
C

Chad Z. Hower aka Kudzu

(e-mail address removed) (Yash) wrote in @posting.google.com:
We want to run an FTP session from a VB .NET program. We redirected
the StandardInput/Output/Error of the Process object that invokes the
FTP program, and also set UseShellExecute to False.

Dont do this - this is a recipe for disaster. Instead use some FTP components
in your program. You might try Indy which is free:

http://www.indyproject.org/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top