一站式外贸综合服务平台,社区网站推广方案,企业云服务平台,绵阳 网站开发python读卡#xff1a;python读卡 最近小唐应要求要开发一个前端的身份证读卡界面#xff0c;结果华视CVR-100UC 的读取界面是在是有点#xff0c;而且怎么调试连官方最基本的启动程序都执行不了。CertReader.ocx 已成功#xff0c;后面在问询一系列前辈之后#xff0c;大…python读卡python读卡 最近小唐应要求要开发一个前端的身份证读卡界面结果华视CVR-100UC 的读取界面是在是有点而且怎么调试连官方最基本的启动程序都执行不了。CertReader.ocx 已成功后面在问询一系列前辈之后大概知道可能是ActiveX组件禁用的问题各种禁用【哭死】。后来去找到了一个比较远古的CVR-100UC读卡是基于后端服务器的exe双击运行即可
资源
链接https://pan.baidu.com/s/1FtC12sv6g45lFMKI4SZMbQ?pwd6boq
提取码6boq
#读卡
http://localhost:19196/readCard
#关闭连接
http://localhost:19196/CloseDevice
#打开连接
http://localhost:19196/openDevice目录结构
代码如下 html
!DOCTYPE html
html langen
headmeta charsetUTF-8titleDocument/title
/head
bodybutton idlj连接设备/buttonbutton idread读取信息/buttonbutton idclose断开连接/buttondivimg idtx src alt身份证照片div iddata/divscript src./js/dy.js/script/div
/body
/html
js
document.getElementById(lj).addEventListener(click, function() {const xhr new XMLHttpRequest();xhr.onreadystatechange function () {if (xhr.readyState XMLHttpRequest.DONE xhr.status 200) {const data JSON.parse(xhr.responseText);document.getElementById(data).innerHTML JSON.stringify(data);}};xhr.open(GET, http://localhost:19196/openDevice);xhr.send();});document.getElementById(read).addEventListener(click, function() {const xhr new XMLHttpRequest();xhr.onreadystatechange function () {if (xhr.readyState XMLHttpRequest.DONE xhr.status 200) {const data JSON.parse(xhr.responseText);const imageBase64 data:image/jpeg;base64, data.identityPic;document.getElementById(tx).src imageBase64;document.getElementById(data).innerHTML JSON.stringify(data);}};xhr.open(GET, http://localhost:19196/readCard);xhr.send();});document.getElementById(close).addEventListener(click, function() {const xhr new XMLHttpRequest();xhr.onreadystatechange function () {if (xhr.readyState XMLHttpRequest.DONE xhr.status 200) {const data JSON.parse(xhr.responseText);document.getElementById(data).innerHTML JSON.stringify(data);}};xhr.open(GET, http://localhost:19196/CloseDevice);xhr.send();});
测试结果