Click here to Skip to main content
15,892,199 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi,
I have been working with some code that was posted here by another user. It's been most helpful, however I need to tweek it slightly and am not sure on how to do it!.

The code is here:

Hardware Helper Library for C#[^]

I was wondering if anyone can shed any light on how to use the SPDRP_HARDWAREID instead of the name?. I have checked the MS SDK, but unfortunately I'm unable to figure out how to do it.

Basically I need to disable then enable only COM port 5 on an XP box, but as there are multiple COM ports all with the same name (SPDRP_DEVICEDESC) "Communication Port" I can't use the Device Name to disable a single COM port. At the moment the code disables ALL COM ports which is no good.

Thanks in advance,

Dan O.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900