I got requirement from client that when any user swipe their card then their details should be capture in web page automatically on client side. However same we are doing in IE by creating ActiveX control in C#. Card service provider install their DLL on client side and from ActiveX control, we can call their DLL and get details.
But now client want the same operation in multiple browser, i.e. Mozilla Firefox and Chrome, which does not support ActiveX control. Can you please give me an idea how it is possible to call client side DLL method from browser?
解决方案
I had to do the exact same thing and I've done it using EdgeJS. You can find the answer at Call Function from DLL loaded in front-end javascript (load dll in clientside javascript) .
At first, I used activex for IE. Then, I had to port it to other browsers. The trick is to marshal functions between V8 and CLR and when the event triggers you send the message to javascript.
The dll returns a delegate function as a receive handler. You initialize the dll with the send handler. I haven't found a method to run the dlls from the browser yet as you do with ActiveX.
It might be that, for security reasons, you might not be able to embed and run dlls in clientside javascript.
The solution in the stackoverflow question is a node process that runs on the client computer that has the Swipe Reader. The client application connects to the node process that runs a websocket server and communicates through websocket messages. I think you can port this on every platform (Win, Unix, MacOS).
Another solution is to build a C# application (windows only if you use .NET, all platforms if you only use the CoreCLR) that listens to swipes and triggers an event to send the data on all connected websockets.