ComponentSpace FTP Class Library Reference

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

Initiates an asynchronous connect using the specified port and that has a specified state object.

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

Parameters

serverAddress
The server address (eg. 207.46.133.140 or ftp.microsoft.com).
port
The server command port.
userName
The user name. "anonymous" for an anonymous user.
password
The password. Normally your email address for an anonymous user.
accountInformation
The account information. If null no ACCT command is sent.
stateObject
A state object, specified by the application, that contains information associated with the asynchronous operation.

Return Value

The IAsyncResult that identifies the posted asynchronous request.

Remarks

In asynchronous processing, you use BeginConnect to raise the ConnectCompleted event when the connect has completed. You complete the operation by calling EndConnect.

Use this overload to associate information with the operation that will be preserved throughout the operation's lifetime. The event handler can detect this information by looking at the AsyncState of the IAsyncResult that is associated with the operation.

See Also

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