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 stateObject As Object _ ) As IAsyncResult
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.
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.