Archived Forum Post

Index of archived forum posts


SFTP Connect success is false

Jan 14 '16 at 11:37

this snippet of code works on three computers just fine success = sftp.Connect(hostname, port); if (success != true) {

but on one machine the success value is false but the LastErrorText show this

ChilkatLog: IsConnected: DllDate: Dec 29 2015 ChilkatVersion: UnlockPrefix: CARRES.CB41216 Username: V1HOUCRSF01PRD:Administrator Architecture: Little Endian; 32-bit Language: .NET 4.0 VerboseLogging: 1 SftpVersion: 0 --IsConnected --ChilkatLog


The LastErrorText you are showing is for the IsConnected method. Remember: The LastErrorText contains information for the last method called. If you call Connect, but then call IsConnect prior to getting the contents of LastErrorText, then you'll be looking at the LastErrorText for the IsConnect method...


this is the first attempt at connecting I am trying to determine why the success value is false on this computer and true on another computer

method that is reporting false

success = sftp.Connect(hostname, port); if (success != true) { if (IsDebugMode) { MessageBox.Show(sftp.LastErrorText); } else {

                        string sl = sftp.SessionLog;

                        _Framework.fwAddError(clsFramework.clsLogging.enumErrorSeverity.High, "", "sftp.Connect", "Unable to Connect to Autoloop SFTP server", "URL = " + hostname.ToString());

                    WriteStatusUpdates(LogServerName, ProcessStartTime, "Not able to Connect to FTP Server");
                    return -1;


Look at the contents of the LastErrorText for the Connect method call. Also, be aware the displaying the LastErrorText in a MessageBox will probably result in truncating the contents. You'll want to see all of it.


Maybe I am dense here but since I have the sftp.LastErrorText after the sftp.Connect is set to false wouldn't that show me the LastErrortext for the Connect method


when this executes how can I see what the caused the connect to be false