Strange behaviour with returned data

Tijmerd

New member
Joined
Nov 10, 2009
Messages
1
Programming Experience
5-10
Hi,

I'm quit new to VB.NET just made the jump from VB6. I tried before using the .NET but always returned to my good old VB6. Until now again, I'm trying to get .NET under the knee.

The current project I'm working on is a client that connects to the Eternal Lands test server and log in.

my problem: When connected to the server you get some kind of banner but there is the problem. I'm getting an empty messagebox. When I try connecting to an SSH server I get the banner in the msgbox... verry strange

here is my code:
VB.NET:
    Private Sub wsClient_DataArrival(ByVal pBytes() As Byte, ByVal pLength As Long) Handles wsClient.DataArrival
        Dim data As String = System.Text.Encoding.ASCII.GetString(pBytes)
        Dim intloop As Integer
        Dim data2 As String
        '
        data2 = vbNullString
        For intloop = 0 To pLength - 1
            data2 = data2 & " " & pBytes(intloop)
        Next
        '
        MsgBox(data)
        MsgBox(data2)
    End Sub

when connecting to the eternal land server data2 seems to contain ascii numbers, but when I put them through the encoding.ascii.getstring() function I get nothing back. when I connect to the SSH server it just contains a string

I tried using different charsets like unicode but still no succes

I'm not sure if I provide enough information so if you need more, just ask.

Sorry if my english is not that good :)

Tijmerd
 
Back
Top