Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to list Com Port usage and list of devices using those ports

How to list Com Port usage and list of devices using those ports

Scheduled Pinned Locked Moved C#
comhelptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    serkan1977
    wrote on last edited by
    #1

    Hello All, I need help for the following subject: I will insert a HW into usb port of my PC, and I want my program to automatically detect the HW and give me the Port Name (or number) and some inforrmation about the inserted HW? Thanks,

    S 1 Reply Last reply
    0
    • S serkan1977

      Hello All, I need help for the following subject: I will insert a HW into usb port of my PC, and I want my program to automatically detect the HW and give me the Port Name (or number) and some inforrmation about the inserted HW? Thanks,

      S Offline
      S Offline
      Samer Aburabie
      wrote on last edited by
      #2

      I can direct you to the correct subject to search for ... search for Serial Port and WMI ... I know that there are WMI classes can help you to play with Serial Port and USB ... here is a link to an article about USB Port insert and remove ... http://www.codeproject.com/script/Forums/Edit.aspx?fid=1649&select=2809641&floc=/script/Forums/View.aspx&fa=r[^] I used WMI for serial before ... but was long time ago ... wish you luck ..

      Sincerely Samer Abu Rabie Note: Please remember to rate this post to help others whom reading it.

      R 1 Reply Last reply
      0
      • S Samer Aburabie

        I can direct you to the correct subject to search for ... search for Serial Port and WMI ... I know that there are WMI classes can help you to play with Serial Port and USB ... here is a link to an article about USB Port insert and remove ... http://www.codeproject.com/script/Forums/Edit.aspx?fid=1649&select=2809641&floc=/script/Forums/View.aspx&fa=r[^] I used WMI for serial before ... but was long time ago ... wish you luck ..

        Sincerely Samer Abu Rabie Note: Please remember to rate this post to help others whom reading it.

        R Offline
        R Offline
        Rahul RK
        wrote on last edited by
        #3

        Hi, Write WndProc in the code and check for device attached/detached event.(There is one event for this. Try to search on net.) After getting event write a code to read registry for com port information. When an device is plugged to USB port an entry is made in the registry.

        HKEY_LOCAL_MACHINE/DEVICEMAP/SERIALCOMM

        So, you can listen for the changes in this key. And will get to know com port at which device is attached.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups