如何在XP中获得usb序列号C# [英] How do I get usb serial number C# in XP

查看:49
本文介绍了如何在XP中获得usb序列号C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标准代码适用于Windows 7/10,但它不适用于XP。

有解决方法吗?

谢谢



我尝试了什么:



我尝试使用本网站上的代码。但它不适用于XP

The standard code works for me in windows 7/10 but it doesnt in XP.
Is there a workaround?
Thanks

What I have tried:

I tried using the code that is on this site. But it doesnt work for XP

推荐答案

我建​​议从这里开始: USB设备如何分配容器ID [ ^ ]



在WinXP中,您必须使用WMI:使用WMI和C#检索硬件标识符 [ ^ ]。要获取USB设备列表,您必须循环遍历 Win32_USBControllerDevice的集合



有关详细信息,请参阅:

ManagementClass Class (System.Management) [ ^ ]

ManagementObjectSearcher类(System.Management) [ ^ ]
I'd suggest to start here: How USB Devices are Assigned Container IDs[^]

In WinXP you have to use WMI: Retrieve Hardware Identifiers with WMI and C#[^]. To get the list of USB devices, you have to loop through the collection of Win32_USBControllerDevice

For further information, please see:
ManagementClass Class (System.Management)[^]
ManagementObjectSearcher Class (System.Management)[^]


这篇关于如何在XP中获得usb序列号C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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