I would like to be able to control a USB device from a web application.
I 开发者_JAVA百科was hoping to use Adobe Flex but I don't think that Flex can support access to USB devices.
Is this possible using Java applets, or a similar approach using .NET?
Thanks.
I don't think any web client platform will allow this. On purpose.
If you find one that does, I will uninstall from all my machines.
With .NET, you could
Create a WinForm control and host it in IE with an object tag. This requires security settings to be set using CASPOL or ActiveDirectory, but you would have full-trust to the machine after this
http://weblogs.asp.net/spano/archive/2007/09/19/hosting-a-windows-form-control-in-a-web-page.aspx
If there is already a COM object on the machine that does what you need, you can access it via Silverlight with elevated permissions.
http://www.silverlightshow.net/items/Silverlight-4-elevated-permissions.aspx
With Applets, you could do it with a trusted applet.
Using a lot of different technologies, you could create ActiveX objects, plugins or browser extensions to do it.
We successfully connected POS devices with a Flex UI... for this we created a bridge application with Merapi which connects Flex (either Air or Web) with Java, and left the connection with the devices to Java... this was for a controlled environment where we where sure that the client had the bridge configured...
Other option is to try Air 2.0 which allows to execute Native code (e.g. Java) to connect to the devices, and you could release your app in Air or develop a bridge this time in Air instead of Java to connect with the browser app
HTH
Gus
Your question is a little unclear because you did not say what computers the web application is running on, what computer the USB device is on, and what computer is yours.
Depending on the details, one possible solution would be to write a Chrome Packaged App and use Chrome USB API. The app would need to be installed on the computer that has the USB device and then it could present a UI to the user or just connect to a remote server and allow the device to be controlled remotely.
精彩评论