VERSION 5.00
Begin VB.Form Conn 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Connect to remote computer"
   ClientHeight    =   1575
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3285
   Icon            =   "Conn.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1575
   ScaleWidth      =   3285
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton Command2 
      Caption         =   "Cancel"
      Height          =   375
      Left            =   2160
      TabIndex        =   5
      Top             =   1080
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Connect"
      Height          =   375
      Left            =   1080
      TabIndex        =   4
      Top             =   1080
      Width           =   975
   End
   Begin VB.TextBox Text2 
      Height          =   285
      Left            =   1080
      TabIndex        =   3
      Text            =   "0"
      Top             =   600
      Width           =   2055
   End
   Begin VB.TextBox Text1 
      Height          =   285
      Left            =   1080
      TabIndex        =   1
      Text            =   "127.0.0.1"
      Top             =   120
      Width           =   2055
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      Caption         =   "Port :"
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   600
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "Connect to :"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   1095
   End
End
Attribute VB_Name = "Conn"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
frmTerm.ws1.Close
frmTerm.ws1.LocalPort = 0
Addr = Trim(Text1.Text)
Port1 = Trim(Text2.Text)
DoEvents
frmTerm.ws1.RemoteHost = Addr
frmTerm.ws1.RemotePort = Val(Port1)
AddStat "Connecting to " & Addr & ", port " & Val(Port1) & " ..."
On Error Resume Next
frmTerm.ws1.connect
If Err <> 0 Then Beep: AddStat "Socket error N" & Err & " (" & Err.Description & ") !"
Unload Me
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
Text1.Text = Addr
Text2.Text = Port1
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Call Command1_Click
If KeyAscii = 27 Then Unload Me
End Sub


Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Call Command1_Click
If KeyAscii = 27 Then Unload Me
End Sub
