how to send and receive data to serial port or USB port in asp.net?

与世无争的帅哥 提交于 2019-12-08 08:39:24

问题


I am developing a web application for a parking I wanna control gateways entrance with a device connected to USB port but we know that browser is in "Sand Box" so no access to computer's port I search the web and found out there is some possibility to do so via ActiveX and/or Java Applets but I'm novice to these things and want a complete tutorial or a wiki book that describe it or even class libraries relative to
I want to send data to a USB or COM Port via asp.net application (Client Side) I know that browsers aren't able to do so because of security issues if anyone provides me an example of ActiveX I will be appreciated.

Thanks in Advance , Saeed Soleimanifar


回答1:


You need to host asp.net net application/website on a server your browser is a client machine. Your client will request a page from server and website could not be hosted on client machine. So you can connect your device to server machine and client sent you request to post data through device e.g gsm modem. Now you need to connect your device to server and you can make a windows service to pull the posted message from database to post them through device.

You need to talk to COM port, even your USB devices listen to COM port. You can use serial port class to communicate with device. You can do this with desktop application and I could not see any reason for using website. The following links will help you.

  • COM port listening
  • Serial port


来源:https://stackoverflow.com/questions/12543874/how-to-send-and-receive-data-to-serial-port-or-usb-port-in-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!