Actually I haven't even got that far as to send text out, this is just
scrambled data that i'm recieving when I connect. Normally in our
telnet software that came with our host system, when I connect it asked
me for my user name and password, I'm guessing this is what is coming
back accross to me but is unreadable, let me show you my code that i'm
using straight from Microsofts website. Let me know if you can see
where somehting might be incorrect.
Option Explicit
Const EchoPort = 23
Private Sub cmdConnect_Click()
Dim temp As String
temp = InputBox$("Enter a server name...", _
"Connect to the Echo Service", Winsock1.RemoteHost)
If temp <"" Then
If Winsock1.State <sckClosed Then Winsock1.Close
Winsock1.RemoteHost = temp
Winsock1.RemotePort = EchoPort
Winsock1.LocalPort = 0
Winsock1.Connect
End If
End Sub
Private Sub cmdDisconnect_Click()
If Winsock1.State <sckClosed Then Winsock1.Close
cmdConnect.Enabled = True
cmdConnect.SetFocus
cmdDisconnect.Enabled = False
End Sub
Private Sub cmdEcho_Click()
Text1.SetFocus
Winsock1.SendData Text1.Text
cmdEcho.Enabled = False
End Sub
Private Sub Winsock1_Close()
If Winsock1.State <0 Then Winsock1.Close
End Sub
Private Sub Winsock1_Connect()
Text2.SetFocus
cmdConnect.Enabled = False
cmdEcho.Enabled = True
cmdDisconnect.Enabled = True
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim temp As String
temp = String(bytesTotal, "*")
Winsock1.GetData temp, vbString, bytesTotal
Text2.SetFocus
Text2.Text = temp
cmdEcho.Enabled = True
End Sub
Private Sub Winsock1_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)
MsgBox "Error: " & Number & vbTab & Description, vbOKOnly, _
"Winsock Control 1 Error"
CancelDisplay = True
End Sub