Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
sckTelnet -> WinSock control
sckTelnet.Protocal = sckTCPProtocal
timerTel -> Timer Control with Interval 500
------------------------------------------------------
Option Explicit
Dim X As Integer
------------------------------------------------------
Private Sub cmdConnect_Click()
If Trim(txtRHostName.Text) = "" Or Trim(txtPortNo.Text) = "" Then
MsgBox "Invalid Entry..."
Else
sckTelnet.RemoteHost = txtRHostName.Text
sckTelnet.RemotePort = Val(txtPortNo.Text)
sckTelnet.Connect
timerTel.Enabled = True
Frame1.Enabled = False
End If
End Sub
------------------------------------------------------
Private Sub cmdSend_Click()
sckTelnet.SendData txtCommand.Text + vbNewLine
txtCommand.Text = ""
End Sub
------------------------------------------------------
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
Unload Me
End If
End Sub
------------------------------------------------------
Private Sub Form_Load()
Frame2.Enabled = False
timerTel.Enabled = False
End Sub
------------------------------------------------------
Private Sub sckTelnet_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
sckTelnet.GetData strData
txtReply.Text = strData + vbNewLine
End Sub
------------------------------------------------------
Private Sub timerTel_Timer()
X = X + 1
If X > 20 Then
MsgBox "Problem encountered connecting Host..."
timerTel.Enabled = False
Frame1.Enabled = True
X = 0
Label6.Caption = X
End If
If sckTelnet.State = 7 Then
Frame2.Enabled = True
Frame1.Enabled = False
lblStatus.Caption = "Connected"
timerTel.Enabled = False
cmdSend.Default = True
Else
lblStatus.Caption = "State:" & sckTelnet.State
End If
Label6.Caption = X
End Sub
------------------------------------------------------