count COM Ports

R

Rainer Borchmann

Hi,

how can i count how many COM ports avaible on a Device ?
I have here on may table a Dell who has COM 0 to COM9 =10 ports
and some ports are named GPD1 to GPD9 , i dont know whats that.
And a Toshiba e 800 who has also 8 COM Ports.

how can i count how many COM ports avaible on a Device with
C# ?

by
Rainer
 
P

Paul G. Tobey [eMVP]

There's no way to do that with 100% reliability on 100% of devices. Of
course, you can enumerate through the registry branch at HKLM/Drivers/Active
and see which ones named COMx: there are.

Some of our devices are capable of being extended beyond 9 COM ports and I
chose SER as the prefix for the next 10 and ASY for the 10 after that, but
those were just strings that I came up with.

Here's an older thread where there is some code I wrote, not managed code,
of course, to count up COM ports. There's also a suggestion there from
Steve Maillet about checking with RAS for serial ports, so maybe that will
help you.

http://groups.google.com/group/micr...5220f7a2cfc4?hl=en&lnk=st&q=#36e85220f7a2cfc4

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top