如何通过WMI将所有智能卡读卡器安装到系统上? [英] How do I get all the smart card readers on my system via WMI?
本文介绍了如何通过WMI将所有智能卡读卡器安装到系统上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用WMI获取系统上所有PCSC智能卡读卡器的DeviceID和服务.它们都通过USB连接,因此我在WMI注册表中查询所有Win32_PnPEntity
.但是我不知道如何确定哪些设备是读卡器".这是我已经拥有的:
I want to get the DeviceID and Service of all PCSC smart card readers on my system using WMI. They're all connected via USB, so I query the WMI registry for all Win32_PnPEntity
s. But I have no clue how to determine which devices are 'card readers'. Here's what I already have:
ManagementObjectSearcher mos =
new ManagementObjectSearcher(@"\root\cimv2", @"Select * From Win32_PnPEntity");
ManagementObjectCollection mob = mos.Get();
foreach (ManagementObject mo in mob)
{
Console.WriteLine("DeviceID: " + mo["DeviceID"].ToString());
Console.WriteLine("Service: " + mo["Service"].ToString());
}
我不能只过滤设备名称,阅读器的品牌/型号不同,也没有共同点.在设备管理器"中,它们都归在智能卡读卡器"下,因此必须有另一种方法.
I can't just filter on the device name, there's different brands/models of readers, and there's no common denominator. In the Device Manager they're all grouped under 'smart card readers', so there must be a(nother) way.
推荐答案
查看全文