Telnet Object : Connect Method |
Visual Basic |
---|
Public Sub Connect( _ ByVal RemoteName As String, _ Optional ByVal RemotePort As Long = 0, _ Optional ByVal LocalName As String, _ Optional ByVal LocalPort As Long = 0 _ ) |
This method blocks if Timeout is greater than 0. The Blocked property may be checked to verify the control is not executing another method.
Error Codes
The Connect method may generate the following error codes (refer to the ErrorConstants topic for a complete list of error codes):
Private Sub Command1_Click() On Error GoTo OnError Telnet1.Connect "catalogue.library.ubc.ca" If Telnet1.State = tcpConnected Then Label1.Caption = "Connection is active and can send/receive data." End If Exit Sub OnError: Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description End Sub