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.TcpClient("melvyl.ucop.edu", 23)
Dim nsns As Net.Sockets.NetworkStream = nstc.GetStream()
If nsns.DataAvailable Then
Dim ab(nstc.ReceiveBufferSize) As Byte
nsns.Read(ab, 0, CInt(nstc.ReceiveBufferSize))
Dim s As String = System.Text.Encoding.ASCII.GetString(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.