WeOnlyDo.Exceptions.SFTP.InvalidStateException: In - WeOnlyDo Discussion board

WeOnlyDo.Exceptions.SFTP.InvalidStateException: In (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Puja Mallik, Tuesday, March 25, 2008, 20:36 (6088 days ago)

I'm receiving WeOnlyDo.Exceptions.SFTP.InvalidStateException: Invalid state. Not connected. error at sftp1.GetFile method using the code below for sftp.

Could you please let me know what I'm doing wrong ?
=====================================================================
WeOnlyDo.Client.SFTP sftp1 = new WeOnlyDo.Client.SFTP();
WeOnlyDo.Security.Cryptography.KeyManager key1 = new WeOnlyDo.Security.Cryptography.KeyManager();

sftp1.LicenseKey = my license key ;

key1.Load( c:abc );
sftp1.Authentication = WeOnlyDo.Client.SFTP.Authentications.PublicKey;
sftp1.Hostname = host_name ;
sftp1.Login = login_name ;
sftp1.PrivateKey = key1.PrivateKey(WeOnlyDo.Security.Cryptography.SSHKeyTypes.RSAKey);
Console.Writeline( Load key ok );
sftp1.Connect();
Console.Writeline( Connect ok );
sftp1.RemotePath = /data ;
Console.Writeline( RemotePath ok );
sftp1.GetFile(LocalPath, filename);
sftp1.Disconnect();
key1.Dispose();
sftp1.Dispose();


Complete thread: