How to get com port label in device manager / ports (com) in C#



  • 1. Match Word File
    HI Guy How to match two word files char by char.Both Files Having Same Data.i am opening both file into richtextbox.if user select some data in richtextbox1 and click the compare button then selected data should be match in richtextbox2.if it's right then ok otherwise it should be highlight by color change. This is too for testing purpose plz help me guys Hemendra
  • 2. Registering VS 2005
    How do you register the 180-day trial? Thanks Kev
  • 3. Help with timer(s)?
    I admit it - I don't have the foggiest notion how to use the timer class(es) in c# - i've looked at tutorials, and it's still completely unintutive to me. Anyone nice enough to get me started on the following problem would be my favorite person in the world! A file is made available on a network drive sometime after noon, and I want to copy it. I want the application to wait until 12 noon, check for the file, if it's there, copy it, if not wait check again every 15 minutes. At 4pm, if the file still hasn't been copied, email a particular person. I've written a "manual" version of the above app, requiring the user to click a button to check for/copy the file. It's the timer stuff that I'm clueless on. Any help would be appreciated... cdj
  • 4. Opening Excel files without Excel being installed
    Hi, I have found many tutorials showing how to access data in an Excel spreadsheet using a COM object in .net. But, as far as I can tell, this requires Excel to be installed. Is there anyway I can access the Excel file without the user needing Excel? Thanks, Chris Riddle

How to get com port label in device manager / ports (com) in C#

Postby vivelafaq » Fri, 23 Feb 2007 16:33:12 GMT

Hi everyone,

I want to find a way to get the label of a com port like displayed in
the device manager in ports :
e.g :
  _Ports (COM & LPT)
        _CP210x USB to UART Bridge Controller (COM3).
I must do a pinvoke ? go in regedit ?

Thanks in advance

Best regards,


Similar Threads:

1.Determine RAS device Com port

Hello Group,

I am using the RASAPI to dial-to the internet using a GPRS modem using

Is it possible before dialling to retreive information about the COM
port that the modem is connected for the RAS entry in the phone book.

What I mean is I have two entires, Entry A and Entry B using devices
on COM 1 and COM 2 respectively.

Can I get information back from the RAS phone book entry about what
COM port my Entry A and Entry B are connected to?  When I use the
Windows RAS Dialer I can see which modem the entry is going to use.



2.How to find which COM port a particular device is installed on

Hi there,

I've got a problem that should be easy to solve, but I'm having a
nightmare in doing so.

We have an app deployed to a large number of laptops and I've
discovered a problem. We've made an assumption that the GPRS card will
always been on COM4. This isn't always the case and I need to code
something that dynamically sets the correct value in the app before
trying to dial.

The client app is in C#. I've been looking at Win32 APIs, such as
SetupDiEnumDeviceInfo and GetDefaultCommConfig, but I can't see how
these are going to help.

I've managed to get a list of all COM ports using a ManagementObject. I
know I can disregard COM1, but I could be left with more than 1 other
port, so need a way of establishing if it's the correct device. Does
anyone have any ideas how I could programatically identify a particular
piece of hardware on these COM ports?

The old VB code the app was translated from just took a list of COM
ports, disregarded COM1 and tried to open a stream on each remaining
one, 'assuming' that the first to respond was the GPRS card. This is
not reliable and I'm not happy replicating that in my code.

It's late, i'm stuck for ideas and really want to get this out the door
tomorrow. Can anyone suggest anything please that ideally doesn't
involve tons of calls to Win32 APIs, although if they're going to bring
something to the table then I'll happily go down that route.

Many thanks,

3."virtual COM port" on PC for communication w/ USB connected CE-device


I would like to communicate from my PC to a CE-device over a USB 
connection, using (virtual) COM ports on both sides.

Does anyone know how I could get a "virtual COM port" on my PC, that 
connects to a CE-device?

Thanks in advance,

4.Virtual COM port for USB port

"Krishnendu Bagchi" <Krishnendu  XXXX@XXXXX.COM > wrote in
message news: XXXX@XXXXX.COM ...
> I have a USB Infra-Red device. Now I want to access the
> USB port where the device is connected as a COM port. In
> short, I want map any available COM port to that USB port
> and pass that COM port address to the widely known
> "CreateFile()" win32 API to get the handle for that port.
> Can any one put some ray of light in this regard.

I can't except to suggest that you post again in



5.Porting from DOS to W32 - COM port

I need to port an application from DOS to W32.

The application wrote and read the hardware directly.

I know I need to use W32 SDK to access COM ports (USB Devices),
obviously the Windows way.

Several questions:

What should I download (of course I have the compiler - C++ Builder 6)?
I suppose I don't have to download the comllete SDK.

What is the relation of these matters with Net Framework?

H. Martins

6. What COM port uses the CF card that provides me a serial port

7. Getting LNK2019 when using com exe while porting from VC6 to VC7

8. Getting list of available COM ports

Return to C#


Who is online

Users browsing this forum: No registered users and 98 guest