System.Net.FtpWebResponse Class

Encapsulates a File Transfer Protocol (FTP) server's response to a request.

See Also: FtpWebResponse Members


public class FtpWebResponse : WebResponse


Instances of System.Net.FtpWebResponse are obtained by calling the FtpWebRequest.GetResponse method. The returned object must be cast to an System.Net.FtpWebResponse. When your application no longer needs the System.Net.FtpWebResponse object, call the FtpWebResponse.Close method to free the resources held by the System.Net.FtpWebResponse.

The FtpWebResponse.StatusCode property contains the status code returned by the server, and the FtpWebResponse.StatusDescription property returns the status code and a message that describes the status. The values returned by these properties change as the messages are returned by the server.

Any data returned by the request, such as the list of file names returned for a System.Net.WebRequestMethods.Ftp.ListDirectory request, is available in the stream returned by the FtpWebResponse.GetResponseStream method. The length of the stream data can be obtained from the FtpWebResponse.ContentLength property.


Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions:,
Since: .NET 2.0