home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmConnect
- BorderStyle = 3 'Fixed Double
- Caption = "Connect"
- ClientHeight = 1920
- ClientLeft = 2115
- ClientTop = 4170
- ClientWidth = 3240
- ClipControls = 0 'False
- Height = 2325
- Left = 2055
- LinkTopic = "Form3"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1920
- ScaleWidth = 3240
- Top = 3825
- Width = 3360
- Begin TextBox txtHostName
- Height = 300
- Left = 1200
- TabIndex = 1
- Top = 240
- Width = 1455
- End
- Begin CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 375
- Left = 1800
- TabIndex = 5
- Top = 1200
- Width = 1215
- End
- Begin CommandButton cmdConnect
- Caption = "&Connect"
- Default = -1 'True
- Height = 375
- Left = 240
- TabIndex = 4
- Top = 1200
- Width = 1215
- End
- Begin ComboBox cmbPort
- Height = 300
- Left = 1200
- TabIndex = 3
- Top = 600
- Width = 1815
- End
- Begin Label Label2
- Caption = "Port:"
- Height = 495
- Left = 120
- TabIndex = 2
- Top = 600
- Width = 1215
- End
- Begin Label Label1
- Caption = "Host Name:"
- Height = 495
- Left = 120
- TabIndex = 0
- Top = 240
- Width = 1215
- End
- ' TELNET Action Property values
- Const CONNECT = 0
- Const LISTEN = 1
- Const CLOSECOMM = 2
- Const ABORTCOMM = 3
- ' TELNET CommState Property Values
- Const CLOSED = 1
- Const CONNECTING = 2
- Const CONNECTED = 3
- Const LISTENING = 4
- Const CLOSING = 5
- ' TELNET commands
- Const GO_AHEAD_CMD = 249
- Const WILL_CMD = 251
- Const WONT_CMD = 252
- Const DO_CMD = 253
- Const DONT_CMD = 254
- Const SB_CMD = 250
- ' Telnet options
- ' NOTE: These are not all possible options. New options
- ' are currently being defined. This list contains many
- ' of the common ones you may use.
- Const BINARY_TRANSMISSION = 0
- Const ECHO = 1
- Const RECONNECTION = 2
- Const SUPPRESS_GO_AHEAD = 3
- Const MESSAGE_SIZE = 4
- Const STATUS = 5
- Const TIMING_MARK = 6
- Const REMOTE_CONTROLLED = 7
- Const OUTPUT_LINE_WIDTH = 8
- Const OUTPUT_PAGE_SIZE = 9
- Const OUTPUT_RETURN_DISPOS = 10
- Const OUTPUT_HORIZ_TABSTOPS = 11
- Const OUTPUT_HORIZ_TAB_DISPOS = 12
- Const OUTPUT_FORM_FEED_DISPOS = 13
- Const OUTPUT_VERT_TABSTOPS = 14
- Const OUTPUT_VERT_TAB_DISPOS = 15
- Const OUTPUT_LINE_FEED_DISPOS = 16
- Const EXTENDED_ASCII = 17
- Const LOGOUT = 18
- Const BYTE_MACRO = 19
- Const DATA_ENTRY_TERMINAL = 20
- Const SUPDUP = 21
- Const SUPDUP_OUTPUT = 22
- Const SEND_LOCATION = 23
- Const TERMINAL_TYPE = 24
- Const END_OF_RECORD = 25
- Const TACACS_USER_ID = 26
- Const OUTPUT_MARKING = 27
- Const TERMINAL_LOC_NUM = 28
- Const REGIME_3270 = 29
- Const X3_PAD = 30
- Const WINDOW_SIZE = 31
- ' TNT Error Values
- Const PT_OK = 0 '/* OK...ErrorDesc should be NULL */
- Const PT_HARDWARE = 1 '/* hardware failure */
- Const PT_PROTOCOL = 2 '/* protocol software failure */
- Const PT_BADNAME = 3 '/* name of host cannot be resolved to address */
- Const PT_CONNREFUSED = 4 '/* connection to host refused */
- Const PT_NOROUTE = 5 '/* no route to host (check network part of address) */
- Const PT_NOHOST = 6 '/* remote host is not available (check host part of address) */
- Const PT_NOMEM = 7 '/* insufficient resources to accept buffer or create channel */
- Const PT_ADDRINUSE = 8 '/* address/port in use */
- Const PT_ALREADYOPEN = 9 '/* PowerTCP daemon/session already open */
- Const PT_CLOSED = 10 '/* graceful close by remote host or us */
- Const PT_ABORTED = 11 '/* connection aborted by remote host or us */
- Const PT_NOTOPEN = 12 '/* attempt made to use a closed session */
- Const PT_NODEVLICENSE = 13 '/* not licensed for development (fatal error) */
- Const PT_NORTLICENSE = 14 '/* not licensed for runtime (non-fatal error) */
- Const PT_SOFTWARE = 15 '/* general software error */
- Const PT_WARNING = 16 '/* general warning */
- Const PT_ERROR = 17 '/* general error */
- Sub cmdCancel_Click ()
- Me.Hide
- End Sub
- Sub cmdConnect_Click ()
- Me.Hide
- ' Select from the different standard telnet ports
- Select Case cmbPort
- Case "telnet"
- ' Standard telnet
- frmTelnet.TNT1.RemotePort = 23
- Case "echo"
- ' Echos back whatever is sent
- frmTelnet.TNT1.RemotePort = 7
- Case "discard"
- ' Does not echo back what is sent
- frmTelnet.TNT1.RemotePort = 9
- Case "daytime"
- ' Returns the date and time
- frmTelnet.TNT1.RemotePort = 13
- Case "chargen"
- ' Generates a stream of characters
- frmTelnet.TNT1.RemotePort = 19
- Case Else
- frmTelnet.TNT1.RemotePort = Val(cmbPort)
- End Select
- frmTelnet.TNT1.RemoteHost = txtHostName
- frmTelnet.TNT1.Action = CONNECT
- End Sub
- Sub Form_Load ()
- cmbPort.AddItem "telnet"
- cmbPort.AddItem "echo"
- cmbPort.AddItem "discard"
- cmbPort.AddItem "daytime"
- cmbPort.AddItem "chargen"
- cmbPort.ListIndex = 0
- End Sub
-