Re: GetFile Stream Problem (General questions)

by Jasmine, (7208 days ago) @ jvongillern

I tried this simple code and works for me. It does nothing smart, just downloads something to stream and then accesses first 20 bytes. [code] static void Main(string[] args)
{
SFTP s = new SFTP();
s.Blocking = true;
s.Hostname = localhost ;
s.Login = kreso ;
s.Password = test ;
s.Connect();

Stream NewMsgStream = new MemoryStream();
//Stream is readable
s.GetFile(NewMsgStream, /HOME/SOMEFILE.TXT );
NewMsgStream.Position = 0;
byte[] b = new Byte[20];
NewMsgStream.Read(b,0,20);
s.Disconnect();
}[/code]

locked

Complete thread: