Reading a network stream from a Telnet site

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?R3JlZw==?=

    #1

    Reading a network stream from a Telnet site

    I am trying to read text from a Telnet site melvyl.ucop.edu . I run the
    following VB .NET 2003 code:

    Dim nstc As New Net.Sockets.Tcp Client("melvyl. ucop.edu", 23)

    Dim nsns As Net.Sockets.Net workStream = nstc.GetStream( )

    If nsns.DataAvaila ble Then
    Dim ab(nstc.Receive BufferSize) As Byte
    nsns.Read(ab, 0, CInt(nstc.Recei veBufferSize))

    Dim s As String = System.Text.Enc oding.ASCII.Get String(ab)
    End If

    But string s ends up as garbage characters. Is it something to do with my
    encoding? This Telnet site is operational through the command line telnet
    application.

Working...