Hello,
I'm a beginner who wanna try to make a simple telnet client app, that connected to TPF mainframe using port 23.
I have coded the app as below:
After the form's loaded, I got the Connect button (named as cmdConnect) appeared, and it's because the winsock (named as con) state not equal to sckConnected.Code:Private Const resdip = "172.25.203.194", telnetport = 23 Private Sub cmdConnect_Click() con.Connect cmdConnect.Visible = False 'prevent to clicked twice End Sub Private Sub con_DataArrival(ByVal bytesTotal As Long) Dim reply_out As String textOut.Visible = True textOut.Text = textOut.Text & reply_out End Sub Private Sub con_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean) txtlog "Something's went wrong!" & Description & Number & vbclrf End Sub Private Sub Form_Load() If con.State = sckConnected Or con.RemoteHost <> resdip Or con.RemotePort <> telnetport Then con.Close End If con.RemoteHost = resdip con.RemotePort = telnetport If con.State <> sckConnected Then textOut.Visible = False cmdConnect.Visible = True 'suppress default value End If End Sub
After I try to connect it, there is no response I got.
Anyone please help me or give me some advise. Any help is appreciated.
Thanks
- Ron -




Reply With Quote