How to get Bus Reported Device Description using C#

后端 未结 4 725
心在旅途
心在旅途 2021-01-19 01:10

I am trying to get a value from windows device manager(windows 7).

The property name i am searching for is Bus Reported Device Description.

I am using the

4条回答
  •  醉酒成梦
    2021-01-19 01:44

    I know this is a bit off-topic, because it's not C#, but for the case someone was also looking for just any solution to get the "bus reported device description" programmatically, like I was (in my case a USB ethernet device) and stumbles upon this question, here is my PowerShell solution based on what I could collect from different sources after searching for some hours!:

    (Get-WMIObject Win32_PnPEntity | where {$_.name -match "ethernet"}).GetDeviceProperties("DEVPKEY_Device_BusReportedDeviceDesc").DeviceProperties.Data
    

    Theoretically speaking, you could use this as a system process in your C# code, but it's a weird method. You might also be able to work directly with WmiObjects somehow, but I have no experience with it in C#.

提交回复
热议问题