Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

winsock vb to telnet session

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have got my winsock to connect to the server with the evil application and am receiving data from the connection. However, the .GetData function is not returning a string as I was lead to believe it should. It is returning Integer types. I don't know how to interpret these responses nor what data to send.

I was expecting to get "login:"
And "Password;" not 255 and 253 and 0 and 23

HELP! Please save what remains of my hair!

wyzerd
 
Sounds like you are getting the IP addr of the connection. Have you tried reading further - are you placing the GetData in the DataArrival event? Do you have the get data set to vbString?

Here is the code from the VB Help file example on GetData

Private Sub Winsock1_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
Winsock1.GetData strData, vbString
Text1.Text = Text1.Text & strData
End Sub


Again maybe you just need to get past the intial communications of the telnet and wait for it to bring in the login function. For example I telnet to my LINUX server all the time using NT telnet; My first line is "Red Hat Linux release 7.0 (Guinness)" the second line is "Kernel 2.2.16-22 on an i586" then finaly the login prompt. Try telneting to the other machince manually and see what is returned. That will give you an idea of when to expect the login prompt.

Hope this helps and please don't pull to hard - it never grows back - trust me I know

Bruce Voelp
bvoelp@if.rmci.net

Earn AS in 1976 and BS in 1986. Learn to talk with computers when the only interface was 80 column punch cards, and paper tape.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top