Mediante questo esempio e possibile ottenere la porta seriale disponibuile sul pc , si esegue il controllo sull proprietà GetPortNames dela Classe SerialPort che restituisce tutte le porte disponibili e attualmente collegatre e attive.

Sample code VB.NET

Private Sub BtnFindSerialPort_Click(sender As System.Object, e As System.EventArgs) Handles BtnFindSerialPort.Click
  For Each ports In My.Computer.Ports.SerialPortNames
   MessageBox.Show("Serial port avialible" & " " & ports)
  Next
End Sub