1

I am developing a web application for a parking. I want to control a gateway entrance with a device connected to USB port, but we know that the browser is in a sandbox, so there isn't any access to the computer's port.

I searched the web and found out there is some possibility to do so via ActiveX and/or Java applets, but I'm a 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 an ASP.NET application (client side). I know that browsers aren't able to do so because of security issues. What would be an example of using ActiveX?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
saeed
  • 2,477
  • 2
  • 23
  • 40

1 Answers1

3

You need to host an ASP.NET application/website on a server. Your browser is on a client machine. Your client will request a page from the server and the website could not be hosted on the client machine.

So you can connect your device to a server machine and the client sends you request to post data through a device, e.g. a GSM modem. Now you need to connect your device to the server and you can make a Windows service to pull the posted message from the database to post them through the device.

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Adil
  • 146,340
  • 25
  • 209
  • 204
  • Hummm , You are right i should connect device to server but i want that when a parking costumer is standing in front of entrance gate way – saeed Sep 22 '12 at 13:24
  • Ok , You are right i should connect device to server but i want that when a parking costumer is standing in front of entrance gate way it opens automatically by checking it's number via a camera and setting a switch enable to open it – saeed Sep 22 '12 at 13:30
  • I need a complete example of writing data on usb port/lpt1/com in asp.net and a complete example to create an activeX that does the following and uses it's functions... – saeed Sep 22 '12 at 13:39