This example configures a Telnet connection, prompts the user for an OpenSystems host, and then establishes the connection.
Note: This sample code is intended to illustrate a concept, and it shows only the code that is relevant to that concept. It may not meet the security requirements for a specific environment, and it should not be used exactly as shown. We recommend that you add security and error-handling code to make your projects more secure and robust. Attachmate provides this sample code "AS IS" with no warranties.
Sub ConnectToTelnetHost ()
Dim whatHost As String
With ThisTerminal
If .IsConnected = True Then
MsgBox"You already have an open connection."
Else
.ConnectionType = ConnectionTypeOption.ConnectionTypeOption_Telnet
whatHost = InputBox("Host to connect to:", "Host Name")
IfwhatHost<>""Then
.ConnectionSettings.HostAddress = whatHost
.Connect
End If
End If
End With
End Sub