如何使用C#获取总线报告的设备描述 [英] How to get Bus Reported Device Description using C#

查看:35
本文介绍了如何使用C#获取总线报告的设备描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Windows设备管理器(Windows 7)获取价值.

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 below code to get device name.

请帮助我获取总线报告的设备说明.

Please help me to get the Bus reported device description.

 void OtherDevices()
    {
        ManagementObjectSearcher deviceList = new ManagementObjectSearcher("Select Name, Status from Win32_PnPEntity");
        if (deviceList != null)
        {
            foreach (ManagementObject device in deviceList.Get())
            {
                string name = device.GetPropertyValue("Name").ToString();
                if (name.Contains("iC5000"))
                {
                    dgv_HWlist.Rows.Add(name);
                    // break;
                }
            }
        }
    }

推荐答案

string description = (string)device.GetPropertyValue("Description");

这篇关于如何使用C#获取总线报告的设备描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆