Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Re: Return error code value = 1

I'm not sure what you mean. WinSCP .NET assembly does not have any exit codes.
With the assembly, you know whether an exception is thrown by Session.Open or Session.PutFiles.

If you mean WinSCP scripting, it indeed has only 0 and 1 exit codes.

Return error code value = 1


I am using the Winscp dll with C#. I am trying to get some error handling in our code. For testing the "remote server down" or "not connected", I tried to use some imaginary or unknown server IP address. The return value seems to be always the value of "1". But the Winscp log says "Proxy error: SOCKS proxy did not accept our authentication".

Is there a way to setup proper code so that it can catch the server down or not connected? (any sample code)

On other things, if the code connected to the remote server and there is no file to be found on that server, then the return value will still be 1.

Any way to make it different return value?