GetResponseStream Method
Collapse the table of content
Expand the table of content

FtpWebResponse.GetResponseStream Method ()

 

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

Namespace:   System.Net
Assembly:  System (in System.dll)

Public Overrides Function GetResponseStream As Stream

Return Value

Type: System.IO.Stream

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

Exception Condition
InvalidOperationException

The response did not return a data stream.

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

An exception is thrown unless the request method is DownloadFile or ListDirectory.

The following code example demonstrates getting the response stream for a ListDirectory request.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft