问题
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