I hope I'll be able to clearly formulate my question.
Scenario: we have an application that integrates with several type of scanners (i.e. credit card, barcode, passport) using serial port interface.
It's the desktop application and can be deployed to run either in stand-alone environment or can be published over terminal services layer (citrix, TS, etc).
In the preferences of the application users are able to specify which scanner is assigned to which COM port.
For example: bar code scanner = COM1, credit card scanner = COM5.
To a user, names of the COM ports don't really make much sense and they won't know that the bar code scanner needs to be assigned to COM1 unless they go to Device Manager and look up the device name associated with the COM port under Ports (COM & LPT)
SerialPort class in .NET Framework has the function GetPortNames that returns the list of available COM ports: COM1, COM3, COM5, COM6, etc.
After doing a little research I found a way to get the descriptive names of each COM port device using WMI.
Here is the code for this: