Computing.Net > Forums > Programming > Finding All Serial & Parallel ports

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Finding All Serial & Parallel ports

Reply to Message Icon

Name: vinayskvs
Date: December 20, 2007 at 03:10:01 Pacific
OS: windows XP SP2
CPU/Ram: 2 Ghz
Product: Intel core 2 duo
Comment:

How to search all system ports in C#.Net...
I have to list all ports names in the combobox, how to proceed with this...??

vinaya.kumar



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: December 20, 2007 at 19:53:03 Pacific
Reply:

I honestly have no idea. If nothing in the System.IO.Ports Namespace works, then I'd probably look at the registry.

Apparently, the GUID for the ports class is {4D36E978-E325-11CE-BFC1-08002BE10318}, so you could use that as a kicking off point.

Also, this PC has one COM port, and it's listed in the registry as

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1
I assume a second COM port would be listed as
 . . . \PNP0501\2
It's not perfect (I'm not sure how Win9X saves its port information), but it might be your best bet.

NOTE: C/C++ documentation I found suggests you let the user type it in, then attempt to open it. If the open fails, you inform the user to type in a new port.


0
Reply to Message Icon

Related Posts

See More


Saving the image in MS-Ac... software help



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Finding All Serial & Parallel ports

Java parallel port control www.computing.net/answers/programming/java-parallel-port-control/10870.html

Parallel Port Access in Assembly www.computing.net/answers/programming/parallel-port-access-in-assembly/11861.html

Visual Basic Code for Parallel port www.computing.net/answers/programming/visual-basic-code-for-parallel-port/9535.html