Export (0) Print
Expand All

FtpWebRequest.EndGetResponse Method

Ends a pending asynchronous operation started with BeginGetResponse.

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

'Declaration
Public Overrides Function EndGetResponse ( _
	asyncResult As IAsyncResult _
) As WebResponse

Parameters

asyncResult
Type: System.IAsyncResult

The IAsyncResult that was returned when the operation started.

Return Value

Type: System.Net.WebResponse
A WebResponse reference that contains an FtpWebResponse instance. This object contains the FTP server's response to the request.

ExceptionCondition
ArgumentNullException

asyncResult is Nothing.

ArgumentException

asyncResult was not obtained by calling BeginGetResponse.

InvalidOperationException

This method was already called for the operation identified by asyncResult.

WebException

An error occurred using an HTTP proxy.

If the operation has not completed at the time the EndGetResponse method is called, EndGetResponse blocks until the operation completes. To prevent blocking, check the IsCompleted property before calling EndGetResponse.

In addition to the exceptions noted in "Exceptions," EndGetResponse rethrows exceptions that were thrown while communicating with the server.

NoteNote

This member outputs trace information when you enable network tracing in your application. For more information, see Network Tracing in the .NET Framework.

Notes to Callers

This method generates network traffic.

The following code example demonstrates ending an asynchronous operation to get a response. This code example is part of a larger example provided for the FtpWebRequest class overview.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft