Getting FTP server response codes

Advertisement

jaimel
Joined:
Posts:
3

Getting FTP server response codes

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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Getting FTP server response codes

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.

Reply with quote

jaimel
Joined:
Posts:
3

Re: Getting FTP server response codes

martin 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.

Reply with quote

Advertisement

You can post new topics in this forum