ComponentSpace FTP Class Library Reference

FtpClient.BeginConnect Method (String, String, String, Object, AsyncCallback)

Initiates an asynchronous connect using the default command port 21 and that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.

[Visual Basic]
Overloads Public Function BeginConnect( _
   ByVal serverAddress As String, _
   ByVal userName As String, _
   ByVal password As String, _
   ByVal stateObject As Object, _
   ByVal asyncCallback As AsyncCallback _
) As IAsyncResult
[C#]
public IAsyncResult BeginConnect(
   string serverAddress,
   string userName,
   string password,
   object stateObject,
   AsyncCallback asyncCallback
);

Parameters

serverAddress
The server address (eg. 207.46.133.140 or ftp.microsoft.com).
userName
The user name. "anonymous" for an anonymous user.
password
The password. Normally your email address for an anonymous user.
stateObject
A state object, specified by the application, that contains information associated with the asynchronous operation.
asyncCallback
The AsyncCallback that will receive the notification of the asynchronous operation completion.

Return Value

The IAsyncResult that identifies the posted asynchronous request.

Remarks

When you use this overload, the callback specified in the callback parameter is invoked directly when the connect has completed; the ConnectCompleted event is not raised. The other overloads of BeginConnect rely on this component to raise the ConnectCompleted event.

See Also

FtpClient Class | ComponentSpace.Ftp Namespace | FtpClient.BeginConnect Overload List