你好,
返回值为空而不是E_ACCESSDENIED似乎说明了这个方法没能够根据ID找到相应的设备。
所以我根据你用的Class去看了一下:
Windows.Devices.Enumeration.DeviceInformation.FindAllAsync的返回是:IAsyncOperation<DeviceInformationCollection>也就是返回的是DeviceInformationCollection这个集合的集合。我觉得你的问题应该跟这里的遍历有关。可能你需要先遍历DeviceInformationCollection集合,再从DeviceInformationCollection里遍历出DeviceInformation然后获取它的ID。
为了验证这个情况,我建议你debug的时候看一看你的设备ID是多少然后直接使用这个方法HidDevice.FromIdAsync配合你的ID看一看结果,如果直接用ID可以的话你试试我上面的方法。
Barry
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.