If you use HidLibrary , you can get a device like this:
_device = HidDevices.Enumerate(VendorId, ProductId, UsagePage).FirstOrDefault(); if (_device != null) { _device.OpenDevice(); string product = GetProductString(_device); string mfg = GetManufacturerString(_device); }
Using the last two functions defined as follows:
private string GetProductString(HidDevice d) { byte[] bs; _device.ReadProduct(out bs); string ps = ""; foreach (byte b in bs) { if (b > 0) ps += ((char)b).ToString(); } return ps; } private string GetManufacturerString(HidDevice d) { byte[] bs; _device.ReadManufacturer(out bs); string ps = ""; foreach (byte b in bs) { if (b > 0) ps += ((char)b).ToString(); } return ps; }
source share