CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2014
    Posts
    1

    Finding the serial device COM port

    I have a Windows C# application . The application connects to a RFID card reader over serial port . Though i have given it COM port 3 by default . I land into situations where user's port is not available and his port being used is something different by his windows OS.

    My application does give user the ability to change the COM port , but to find which COM port is being used by their operating system , user needs to go to Device Manager and check , which a novice person might not be comfortable with .

    Is there a function or a way to find exactly to what port is my RFID card connected to in Windows , so that i can simply display like :

    Application Port Set to : COM .... Device Connection Port on OS : COM ....

    Also my target framework is 3.5

    Edit 1:

    Tried using SerialPort.GetPortNames() but it returns an empty string as : System.String[]..

    My RFID device is listed under Device Manager ===> Ports(COM & LPT) as Silicon Labs CP210x USB to UART Bridge (COM3)

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Finding the serial device COM port

    UART Bridge divides settings to share ports. I'd look that up.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured