0
出於某種原因,我不能將文本追加到我從tcpclient流獲取的數據中。將文本追加到來自tcpclient的字符串?
Dim Client As New TcpClient("server", port)
Dim stream As NetworkStream = Client.GetStream()
Dim receiveBytes As [Byte]() = New [Byte](Client.ReceiveBufferSize) {}
Dim returnData As [String] = [String].Empty
stream.Read(receiveBytes, 0, CInt(Client.ReceiveBufferSize))
returnData = Encoding.ASCII.GetString(receiveBytes)
MsgBox(returnData + "hello")
消息框將只包含沒有hello的returnData字符串。
是我送自己的數據爲ASCII。感謝您的迴應,完美工作。 – Shawn 2011-02-26 16:44:25