本文介绍了无法在UWP中使用HIDDevice类打开设备的句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我们的应用程序,名为Hellokey,已在Store上提供,它可作为Windows Hello的配套设备管理器。 我们用于打开我们的句柄的函数HID设备如下,在某些Windows 10系统上不起作用。 string selector = HidDevice.GetDeviceSelector(0x0f0b,0x0001); var devices = await DeviceInformation.FindAllAsync(selector); if(devices.Count> 0) { currentDevice = await HidDevice.FromIdAsync(devices.ElementAt(0).Id, FileAccessMode.ReadWrite); } 它返回的错误提到设备正忙,但同时使用使用.NETFramework API的WPF应用程序我可以打开并运行HID设备。 我遇到的唯一解决方案是重新安装或使用'Fresh'选项,我必须完全删除所有已安装的应用程序。 你能否帮助找到问题的根源HIDDevice真的不稳定。 解决方案 Our application, named Hellokey, is already available on Store which works as a manager of companion device for Windows Hello.The function we use for opening a handle to our HID device is as follow which doesn't works on some windows 10 systems.string selector = HidDevice.GetDeviceSelector(0x0f0b, 0x0001);var devices = await DeviceInformation.FindAllAsync(selector);if (devices.Count > 0){ currentDevice = await HidDevice.FromIdAsync(devices.ElementAt(0).Id, FileAccessMode.ReadWrite);}The error it returns mentioning that the device is busy, but at the same time using WPF application which uses .NETFramework API I can open and work the HID device.The only solution I have for this issue is reinstalling or using the 'Fresh' option where I have to remove all the installed application entirely.Could you please help with finding the source of the problem HIDDevice is really unstable. 解决方案 这篇关于无法在UWP中使用HIDDevice类打开设备的句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!