Hi, I'm new to the forums so please forgive me if I post this in the wrong section.
Anyway I'm having a problem where if I convert a string to bytes then send it through TCP, on the other end it does not convert properly. The original string is present in the received bytes although there appears to be some hidden characters stopping me from using a select case. Rough code is below...

TCP Message Server Code:
  1. Private Sub Listen()
  2.  
  3.         Dim LST_PORT as int16 = 9292    'Port to listen on'
  4.         Dim TCP_LISTEN As TcpListener = New TcpListener(LST_PORT)
  5.         TCP_LISTEN.Start()
  6.  
  7.         Try
  8.  
  9.             Dim TCP_CLIENT As TcpClient = TCP_LISTEN.AcceptTcpClient
  10.  
  11.             Dim NET_STREAM As NetworkStream = TCP_CLIENT.GetStream
  12.  
  13.             'reading data'
  14.             Dim bytes(TCP_CLIENT.ReceiveBufferSize) As Byte
  15.  
  16.             NET_STREAM.Read(bytes, 0, TCP_CLIENT.ReceiveBufferSize)
  17.  
  18.             Dim RX_STRING As String = Encoding.ASCII.GetString(bytes)
  19.  
  20.  
  21.             Select Case RX_STRING.Trim.ToUpper
  22.  
  23.                 Case "1"
  24.                     Console.Beep()
  25.                 Case "SHUTDOWN"
  26.                     Process.Start("shutdown", "-f -s -t 00")
  27.  
  28.                 Case Else
  29.  
  30.                     MsgBox(RX_STRING, MsgBoxStyle.OkOnly, "...")
  31.  
  32.  
  33.             End Select
  34.  
  35.             TCP_CLIENT.Close()
  36.  
  37.         Catch ex As Exception
  38.  
  39.         End Try
  40.         TCP_LISTEN.Stop()
  41.  
  42.  
  43.     End Sub


Problem is if I send "beep" from the client program, rather than beeping the program instead follows the 'case else' and displays "beep" in a message box.
Any help would be very much appreciated. Thank you.