| End Function
Private Function Prompt() As String
If Not Prompted Then
Console.Write(Cmd)
Prompted = True
End If
Return Console.ReadLine
End Function
Private Sub thrListener() ''''侦听线程
Dim bytes(4096) As Byte
Dim NumGet As Integer
Dim Msg As String
While True
Debug.WriteLine("Waiting for a message...")
NumGet = listener.Receive(bytes) ''''接收
Prompted = False
Msg = Encoding.Unicode.GetString(bytes, 0, NumGet) ''''与发送消息一样使用unicode编码
Console.WriteLine(vbCrLf & ">>>>>>>>>" & Msg & vbCrLf)
If Not Prompted Then
Console.Write(Cmd)
Prompted = True
End If
End While
End Sub
Private Sub ShowHelp()
Console.WriteLine("")
Console.WriteLine("========================================================================")
Console.WriteLine("This program is very simple, you can type ""exit"" to exit program.")
Console.WriteLine("========================================================================")
Console.WriteLine("")
End Sub
End Module
上一页 [1] [2] [3] |