Um pouco do código:send = System.Text.Encoding.UTF8.GetBytes("TYPE I\r\n"); strm.Write(send, 0, 8); b = new byte[256]; strm.Read(b, 0, 256); result = System.Text.Encoding.UTF8.GetString(b); send = System.Text.Encoding.UTF8.GetBytes("PASV \r\n"); strm.Write(send, 0, 7); b = new byte[256]; strm.Read(b, 0, 256); result = System.Text.Encoding.UTF8.GetString(b); send = System.Text.Encoding.UTF8.GetBytes("MLSD \r\n"); strm.Write(send, 0, 7); b = new byte[256]; strm.Read(b, 0, 256); result = System.Text.Encoding.UTF8.GetString(b);Eu estou recebendo isso de retorno do servidor:
127.0.0.1:51198> Recv: AUTH TLS127.0.0.1:51198> Sent: 500 'AUTH': command not understood.127.0.0.1:51198> Recv: AUTH SSL127.0.0.1:51198> Sent: 500 'AUTH': command not understood.127.0.0.1:51198> Recv: USER anonymous127.0.0.1:51198> Sent: 331 Password required for anonymous.127.0.0.1:51198> Recv: PASS anon@localhost127.0.0.1:51198> Sent: 230 User Anonymous logged in.127.0.0.1:51198> Recv: CLNT FileZilla127.0.0.1:51198> Sent: 200 Noted OK.127.0.0.1:51198> Recv: OPTS UTF8 ON127.0.0.1:51198> Sent: 200 UTF8 ON Ok.127.0.0.1:51198> Recv: PWD127.0.0.1:51198> Sent: 257 "/" is current directory.127.0.0.1:51198> Recv: TYPE I127.0.0.1:51198> Sent: 200 Type set to I.127.0.0.1:51198> Recv: PASV127.0.0.1:51198> Sent: 227 Entering Passive Mode (127,0,0,1,199,255).127.0.0.1:51198> Recv: MLSD127.0.0.1:51198> Sent: 150 Opening data connection for directory list.
A questão é que dai para frente eu não consigo pegar a lista de arquivos e pastas no servidor FTP
Me parece que eu tenho que pegar de uma forma assincrona mas não tenho idéia de como fazer.
Alguem que já tentou fazer um cliente ftp através de TCPclient pode me dar uma ajuda? Desde já grato.
Graças a ajuda que ninguém tentou ao menos dar eu consegui, pesquisando em inglês eu achei as respostas para as minhas perguntas e aprendi a fazer um servidor e um client ftp funcional.
Com a junção desses 2:
http://stackoverflow...om-passive-mode
https://tools.ietf.org/html/rfc959