Morning All,VB IRC客户端 - writeStream只在IRC中显示单个字
我一直在用Visual Basic编写一个非常简单的IRC客户端。当我写入网络流时,我有一个非常棘手的问题。在其他客户端,我的消息在第一个空格字符后切断。我确信这是简单的,因为消息正在发送,接收很好,并且在我阅读消息的任何地方调试问题(例如,如果我调试打印正在写入流的消息,它仍然包括所有的单词和空格。)这是我的代码。
在此先感谢
'Send data to IRC Server
Sub Send(ByVal message)
Try
'Reformat message to IRC command
message = message & vbCrLf
Debug.Print(message)
'Convert message string into bytes
Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(message)
'Write data to stream
ircStream.Write(sendBytes, 0, sendBytes.Length)
'Run test to see if the string sent matches the user input
Dim messageSent As String = Encoding.ASCII.GetString(sendBytes)
Debug.Print(messageSent)
'Display message on the screen(0 = Sent Formatting)
PrintToScreen(message, 0)
Catch ex As Exception
'Catch error and display error message in the debug console
Debug.Print("Error Sending")
End Try
End Sub
您是否尝试过冲洗? – 2010-11-16 11:31:02
没有抱歉,伙伴什么是冲洗大声笑? – Gary 2010-11-16 11:38:56