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

        response.StatusDescription

How can I look up the description for the return code that I have from my ftp client?

Answers


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.


Need Your Help

Skip a setInterval every X loop?

javascript jquery loops setinterval

I have a function that gets triggered every 10 seconds with a setInterval(); loop, and I'd like it to skip a call every 60 seconds. So the function would be executed at 10s, 20s, 30s, 40s and 50s but

gridview asp.net mouse over TR find which row was clicked on server side code

asp.net javascript gridview

I am pretty new to the whole javascript thing. I have a gridview that I want the user to be able to hover over the whole row (believe its the whole TR) and be able to click anywhere and that would...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.