In the form of. net, the original COM technology still has its own unique use. I recently saw this post on csdn, which is also very enlightening.
Hjk1 ():Recently, the project needs to process data transmitted from devices through serial ports on the client. I think this project can only be made into a C/S structure, because all the business logic of the B/S structure is on the server, it is impossible to receive data from the serial port of the device directly connected to the client. At first, the boss agreed with me,
Zhilunchen (heshan jushi): Boss, this stuff can be implemented! I have successfully read and written the IC card through the card reader (Serial Port) on the client (B/S!
The method is to first encapsulate the code for reading and writing the serial port into a COM component, and then call the COM Component Interface on the client through Js.
At first, I also agreed with the idea of hjk1 (), which is difficult to implement in B/S. But I can see the reply below, so I won't be satisfied with it. I think back to my previous projects, in fact, this method has been used. COM component + JavaScript method. So you can try it yourself. Create an ActiveX control with VB6.0, and then register the control with regsvr32. net to create a web application, select Add COM component in the tool panel, and drag and drop the ActiveX control from the tool panel to the page, this completes a simple process from creation to reference. You can complete a lot of functions in your ActiveX control and provide the method for calling the foreground script Js.