Dim bty() As Byte With Ports("COM3") bty = .GetBytes("狐表很强大") '转换为字节数组 .Write(bty, 0, bty.length) '发送字节数组 End With Output.Show(bty.length) Dim p As Port = Ports("COM3") Dim cnt As Integer = p.BytesToRead If cnt > 0 Then '缓冲区是否有数据 Dim bty1(cnt - 1) As Byte Dim val As String p.Read(bty1,0,cnt) '接收字节数据 Val = p.GetString(bty1) '转换为字符 '后续处理代码 Output.Show(Val) End If