[UWP] [C#] [USB] [扫描仪]连接并从USB扫描仪获取数据 [英] [UWP][C#][USB][Scanner] Connect and Get the data from USB Scanner
问题描述
hi team,
我有windows 10平板电脑,它集成了scnaner,设备管理器在winusb端口下显示它。
I have windows 10 tablet which has scnaner integrated and the device manager shows it under winusb port.
我已尝试使用此链接https://msdn.microsoft.com/en-us/library/windows/hardware/dn312121(v = vs.85).aspx但我我得到以下错误:"(评估方法System.Linq.SystemCore_EnumerableDebugView`1 [Windows .Devices.Enumeration.DeviceInformation] .get_Items()
调用COM方法System.Collections.Generic.IEnumerable`1 [Windows.Devices.Enumeration.DeviceInformation] .GetEnumerator()。不支持对COM对象的方法进行评估在这种情况下。)"
I have tried https://msdn.microsoft.com/en-us/library/windows/hardware/dn312121(v=vs.85).aspx with this link but i am getting below error: "(Evaluation of method System.Linq.SystemCore_EnumerableDebugView`1[Windows.Devices.Enumeration.DeviceInformation].get_Items() calls COM method System.Collections.Generic.IEnumerable`1[Windows.Devices.Enumeration.DeviceInformation].GetEnumerator(). Evaluation of methods on COM objects is not supported in this context.)"
我正在尝试从过去4-5天连接扫描仪并从扫描仪读取一些值。
I am trying from past 4-5 days to get connected to scanner and read some values from scanner.
如果有样品通过winusb连接到扫描仪,请告诉我。
Please let me know if there is a sample to connect to scanner through winusb.
谢谢,
niteshkr12
niteshkr12
推荐答案
您好NiteshKr12,
Hi NiteshKr12,
有官方样本关于 自定义USB设备示例,它显示了如何使用Windows.Devices.Usb命名空间与USB设备进行通信,请在此链接中查看: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CustomUsbDeviceAccess 。
There is an official sample about Custom USB device sample, it shows how to communicate with a USB device by using the Windows.Devices.Usb namespace, please refer it in this link: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CustomUsbDeviceAccess.
样本没有连接到扫描仪,如果你想要扫描仪的样本,你应该可以在Github中请求它。
The sample does not connect to scanner, if you want the sample for scanner you should able to request it in the Github.
还有一个关于Windows的官方文档存储USB设备的应用程序,请在此链接中查看: https://msdn.microsoft.com/ library / windows / apps / dn303355 。
Also there is an official document about Windows Store app for a USB device, please refer it in this link: https://msdn.microsoft.com/library/windows/apps/dn303355.
最好的问候,
Jayden Gu
Jayden Gu
这篇关于[UWP] [C#] [USB] [扫描仪]连接并从USB扫描仪获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!