SerialPort.GetPortNames will list all serial COM ports. Unfortunately, parallel ports are not supported directly from C#, as they're very infrequently used except in legacy situations. That said, you can list them by querying the following registry key: HKEYLOCALMACHINE HARDWARE DEVICEMAP PARALLEL PORTS See the Microsoft.Win32 namespace for. Waveshare Barcode Scanner Module 1D/2D Codes Barcode, QR Code Reader Onboard Micro USB and UART Serial Port Directly Plugged into Computer $49.55 $ 49. 55 Get it as soon as Tue, Sep 17.
RS232 serial barcode scanners connect to the computer's serial port and send its information to the screen or to any program. Serial barcode scanners are more complex than keyboard wedge barcode scanners, but are much more versatile: barcode data can be edited, re-ordered or changed before it is displayed, allowing customization of applications collecting and using barcode data. Free Serial Analyzer Features. Free Serial Port Analyzer is able to capture and decode monitored packets in real-time even under high traffic load. This Freeware Serial Port Monitor supports all standard Bit rates of 75, 110, 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600 and 115200 bit/s.
Active2 years, 10 months ago
Does C# provide an effective means of scanning the available COM ports? I would like to have a dropdown list in my application wherein the user can select one of the detected COM ports. Creating and populating the dropdown list is not a problem. I just need to know how to scan for the available COM ports using C#. I am using Microsoft Visual C# 2008 Express Edition. Thanks.
Jim Fell
Jim FellJim Fell5,8442828 gold badges108108 silver badges183183 bronze badges
2 Answers
System.IO.Ports is the namespace you want.
![Port Port](https://ae01.alicdn.com/kf/HTB1qX64jzihSKJjy0Ffq6zGzFXaD/LV3296R-RS232-2D-qr-code-pdf417-barcpde-scanner-reader-for-reader-card-Serial-port.jpg)
SerialPort.GetPortNames will list all serial COM ports.
Unfortunately, parallel ports are not supported directly from C#, as they're very infrequently used except in legacy situations. That said, you can list them by querying the following registry key:
See the Microsoft.Win32 namespace for details.
RandolphoRandolpho48.8k1515 gold badges125125 silver badges167167 bronze badges
Use WMI through the System.Management namespace. A quick Google finds this code:
James WestgateSerial Port Scanner
![Port Port](https://img.alicdn.com/imgextra/i4/190647015/TB2ovqMhFXXXXXgXXXXXXXXXXXX_!!190647015.jpg)
8,81266 gold badges4646 silver badges6060 bronze badges