Topic "Getting FTP server response codes"

Author Message
jaimel
[View user's profile]

Joined: 2016-03-04
Posts: 3
Hello everyone,
I'm using the WinSCP's .NET library with C#. I was wondering if you guys could help with an issue I'm having.

I have a service set up to go through a list of ftp connections. One specific ftp server once in a while will respond with Code 426 (Connection closed; transfer aborted.) and when this happens I need to run custom logic.
I'm unable to find anything within the .NET assembly that could return me the actual code. I see that they are being logged in the session log along with the description, but I'm trying to stay away from having to parse through the log.

Is there any methods/events that I'm overlooking that could help with this?
Or is WinSCP's .NET assembly unable to handle this atm?

Any help will be appreciated.
Thank you.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
There's no explicit API to retrieve an underlying protocol error code. All you can do is to parse the code from the exception message.
jaimel
[View user's profile]

Joined: 2016-03-04
Posts: 3
prikryl wrote:
There's no explicit API to retrieve an underlying protocol error code. All you can do is to parse the code from the exception message.


Thank you for your response.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License