如何从网页中的串行端口读取 [英] How to read from Serial port in a webpage
问题描述
我想设计一个Web表单,用户应填写一些字段。应该从连接了特殊硬件的客户端计算机的串行端口(COM1)读取一个字段的值,并且用户按下硬件的发送到PC
键填写表格时。
I want to design a webform that user should fill some fields. The value of one field should be read from Serial port (COM1) of client computer which a special hardware is connected to it and the user presses the Send to PC
key of the hardware when filling the form.
我如何在网页中收听 COM1
端口并获取COM1的值并将其放置在网络中
How i can listen to COM1
port in my webpage and get the value of COM1 and place it in the web form automatically?
我听说ActiveX控件可以做到这一点,但它仅与IE兼容(对吗?)。另一个选择是Java applet。
I heard that ActiveX controls can do this but it is compatible only with IE (right?). The other option is Java applets.
我想要一个简单的解决方案,该解决方案至少与IE / Firefox / Opera兼容。
I want a simple solution which be compatible with (at least) IE/Firefox/Opera.
我可以在服务器端使用ASP或PHP,但如果您能为每个解决方案提供解决方案,我将不胜感激。
I the server-side i can have ASP or PHP but i am appreciate if you give a solution for each.
更新:
我们可以告诉客户更改其安全设置以接受我们的ActiveX /小程序。
We can tell clients to change their security settings to accept our ActiveX/applet.
它我们也可以告诉客户安装一个自定义程序,该程序作为服务运行并从串行端口读取。
It is also possible for us to tell clients to install a custom program which runs as a service and reads from Serial port.
问题是读取的数据应输入到
The problem is the read data should be entered to the webform automatically and immediately.
java applet是个好主意,但是客户端必须安装较大的JRE。
The java applet is a good idea, but the client have to install JRE which is large in size.
还有其他选择吗?
推荐答案
使用Java Applet可以从串行端口读取,但是您可以出于安全原因需要签署小程序。要非正式地变硬(没有太阳变硬),您必须创建证书。 此处是一个示例。
With a Java Applet you can read from the serial port but you need to sign the applet for security reasons. To firm unofficially (no sun's firm) you have to create a certificate. Here is an example.
这篇关于如何从网页中的串行端口读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!