Imports System.IO.Ports Public Class UartServer ''' ''' 串口句柄 ''' Public Uart As SerialPort Sub New(UartPort As String, UartBaud As Long, Uartdata As Long, UartParity As Parity, dataBits As Integer, UartStop As Integer) Uart = New SerialPort(UartPort, UartBaud, UartParity, dataBits, UartStop) End Sub ''' ''' 打开串口 ''' ''' Public Function UartOPen() As Boolean Try Uart.Open() Catch ex As Exception End Try Return Uart.IsOpen End Function Public Function UartSenddata(sendbuff() As Byte) ' Uart.s End Function End Class