count COM Ports

  • Thread starter Thread starter Rainer Borchmann
  • Start date Start date
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
 
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.
 
Back
Top