How to get information from device manager?

How can I read specific device information in my C # application? I tried WMI and it does not provide the information I need.

The information I want is stored on the Details tab of the device, and the information I want is Parent.

I also looked at regedit, with no luck.

+6
source share
2 answers

Microsoft provides a sample: http://support.microsoft.com/kb/311272

From C #, it might be easier to grab the devcon output than integrate the API. If you like it, C ++ / CLI is the easiest way to get device information in .NET (I did this before).

0
source

These APIs should catch you: http://msdn.microsoft.com/en-us/library/ff550630(VS.85).aspx#retrieving_the_parent_of_a_device_inst

It seems that SetupAPI can be used as an alternative in Windows Vista or later. The above method works on Win2000 +

0
source

Source: https://habr.com/ru/post/894285/


All Articles