Pavel Radzivilovsky Pavel Radzivilovsky - 7 months ago 62
C# Question

How to open a serial port by friendly name?

friendly name = the name that appears in "Device Manager" under "Ports (COM & LPT).

EDIT: two solutions provided below. One with WMI and another with SetupAPI.


Try running a WMI query on the Win32_SerialPort class. Download WmiCodeCreator to experiment and auto-generate the C# code.