FtpWebResponse.GetResponseStream Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

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

override GetResponseStream : unit -> 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: