Public NotInheritable Class Helper Public Shared Function SerialPortExists(ByVal portNumber as Integer) As Boolean Dim ports As String() ports = SerialPort.GetPortNames() Return Array.Exists(Of String)(ports, Function(p) p.Equals("COM" & portNumber.ToString())) End Function End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)