I had a previous question regarding a way to access a proxy card from within a web page when using Chrome. I'm now attempting to instead use a vb.Net application with an embedded CefSharp object. I have the code I need to access the proxy card (thanks to Smart Card API), but I need an easy way to indicate that this is even an option. My thought is to:
- Put an otherwise empty element on the web page (such as
<div id='smartcard' />
) - Inside Visual Basic, monitor the contents of the page for this
<div />
- If the
<div />
is found, make sure the card reader is detected. If so, add some text (and maybe an image) to its contents indicating the the card can be scanned - Once a card scan is detected, put the value from the card into a form element and POST it
- If the
It seems likely to me that I'm going to have to use some combination of JavaScript and vb.net code, but I'm so new to CefSharp that I really have no idea where to start.
Thanks in advance for all your help.
Not being a C# programmer, I looked at the information on the General Usage guide many times and still didn't really understand it. That said, I think I've been able to get this project off the ground. In addition to the CefSharp project, I'm also using the non-free Smart Card API from CardWerk.
Below is some snippets of what I did.
VB.Net
JavaScript
(This is in a
.js
file that is loaded by the web page. This page can also be loaded in Chrome, Firefox, IE, etc and these functions will never be run which keeps this utility usable for computers that don't have the custom.exe
and card reader).In my actual code, I have multiple
else if
statements for dealing with different forms where I allow a card to be scanned. They are not included to keep this from getting out of hand :).Please Note: This is not intended to be the entire project or all the code needed to process prox cards using CefSharp. My hope is that it will be enough to help somebody else.