How to get an FtpWebResponse description for a given ftp exit code?
I have an FTP class that I can get the response code (or description) as expected:
FtpWebResponse response = (FtpWebResponse)request.GetResponse(); response.StatusCode;
Due to a bug in mono for uploading, we have coded a work around that does not use the FTPWebRequest and related classes but uses the ftp client (on linux).
In .Net/Mono the FtpWebResponse class looks up the code to get the description
How can I look up the description for the return code that I have from my ftp client?
The descriptions are not looked up, they are sent by the server as part of the status message. In mono the FtpWebRequest.GetResponseStatus method breaks apart the messages received to get the description.
For a few local error conditions, the code fakes ftp status messages from hard-coded strings, such as:
new FtpStatus (FtpStatusCode.ServiceNotAvailable, Locale.GetText ("Invalid response from server"));
You should probably try to fix whatever bug you have run into instead of hacking together workarounds. That's how open source is supposed to work.