C#获取指定usb设备的厂商信息
string vid = "04B4";
string pid = "1003";
string query = $"SELECT * FROM Win32_PnPEntity WHERE DeviceID LIKE '%VID_{vid}%&PID_{pid}%'";
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
ManagementObjectCollection devices = searcher.Get();
foreach (ManagementObject device in devices)
{
string manufacturer = device["Manufacturer"] as string;
string description = device["Description"] as string;
string deviceId = device["DeviceID"] as string;
Console.WriteLine("Manufacturer: " + manufacturer);
Console.WriteLine("Description: " + description);
Console.WriteLine("DeviceID: " + deviceId);
}