这有可能提供的JavaScript API来控制USB,LPT,COM设备? [英] Is that possible to provide javascript API to control USB, LPT, COM devices?

查看:591
本文介绍了这有可能提供的JavaScript API来控制USB,LPT,COM设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一台计算机上运行的窗口,并与许多设备,如打印机,RFID阅读器等连接
我希望我所有的应用程序运行的HTML,CSS,JavaScript,因此我需要通过JavaScript访问这些设备。但我不知道这是否是可能的自定义JavaScript API添加到浏览器(如IE或Firefox),或者是工作需要,使这成为可能。

I have a computer running windows and connected with many devices, such as printer, RFID reader, etc. I want all my apps run as HTML, CSS, Javascript, so I need to access these devices through Javascript. But I don't know if it is possible to add custom Javascript API to browser (such as IE or Firefox), or what work are needed to make this possible.

感谢

推荐答案

您可以使用浏览器的基本打印能力控制打印机,并能够找到一个键盘楔RFID读写器,两者都将让你只使用基本JS来操作。但是,您很可能将需要一个ActiveX控件(COM组件),您可以从浏览器的脚本实例才能够有超过设备任何真正控制了。

You can use a browser's basic printing abilities to control a printer and may be able to find a keyboard wedge RFID reader, both of which would allow you to use just basic JS to operate them. However, you more than likely will need an ActiveX control (COM component) that you can instantiate from a browser script to be able to have any real control over the devices.

不幸的是,你可能不得不自己编写的控制。您的可能的能够与一些明智地使用的P / Invoke做它在C#中,但是。

Unfortunately, you may have to write those controls yourself. You might be able to do it in C# with some judicious use of P/Invoke, however.

这篇关于这有可能提供的JavaScript API来控制USB,LPT,COM设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆