in the Compact Framework, the Ftp protocol is not implemented, so I developed it myself.
I have a question about passive mode and the commands that should have a data channel to read the response.
In my case, I am trying to restore (RETR) a file on my FTP server, so I:
The part that works well:
- Opencontrolchannel
- ReadControl (banner message)
- Senduser
- ReadControl (pending pass?)
- SENDPASS
- ReadControl (greeting message)
- Send passive
- ReadControl (Extract IP for DataChannel)
Parts that do not work very well (but work too, see explanation below)
- RETR myFile
- Opendatachannel
- ReadControl (Here I put the message "Begin Transfert" AND "Transfert complete", before reading any data!)
- ReadData li>
- CloseDataChannel
- CloseControlChannel
, , "Transfert complete", , ?
, ,
"150 ASCII a.she(0 ).\r\n"
:
"226 . \r\n"
Ftp, .NET Framework, :
FtpWebResponse ftpres = (FtpWebResponse)ftp.GetResponse();
string res = new StreamReader(ftpres.GetResponseStream()).ReadToEnd();
, ...
!