There is a simpler way to do that, please have a look at the DownloadFile method: [http://doc.componentpro.com/ComponentPro-Ftp/ComponentPro-Net-Ftp-DownloadFile(System-String,System-IO-Stream,System-Int64,System-Int64)][1].
You can try the following:
using (var mem = new MemoryStream())
{
ftp.DownloadFile('/remotefile', mem, 0L, 10L);
// check your downloaded content here by accessing bytes in the mem stream.
}
[1]: http://doc.componentpro.com/ComponentPro-Ftp/ComponentPro-Net-Ftp-DownloadFile(System-String,System-IO-Stream,System-Int64,System-Int64)
edited 4/2/2018 4:24:31 PM
answered 4/2/2018 8:13:03 AM