System.Net.FtpWebResponse.GetResponseStream Method

Retrieves the stream that contains response data sent from an FTP server.

Syntax

public override System.IO.Stream GetResponseStream ()

Returns

A readable System.IO.Stream instance that contains data returned with the response; otherwise, System.IO.Stream.Null if no response data was returned by the server.

Remarks

After reading the data, you must close the stream. The stream is automatically closed when you close the System.Net.FtpWebResponse object that contains it.

An exception is thrown unless the request method is System.Net.WebRequestMethods.Ftp.DownloadFile or System.Net.WebRequestMethods.Ftp.ListDirectory.

Requirements

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