神思SS628(100)型第二代身份证验证阅读机具是神思电子一款经典产品

B/S项目中需要读取个人的身份信息进行登记,为了提高效率,选择了神思电子的神思SS628(100)型第二代身份证验证阅读机,

具体使用步骤如下:

首先下载驱动包,由于该功能也是基于ocx插件进行交互的,,所以要先安装驱动

下面提供下载地址:根据自己的系统型号进行安装

链接:https://pan.baidu.com/s/15uecO4aCmM_Jq76uXDOi8A
提取码:z1g8

同时产家也提供了B/S下的Demo进行测试

下载地址:

链接:https://pan.baidu.com/s/1V47BvjmBHw7L8QywF3E_1Q
提取码:9yg2

 

  1. <HTML>
  2. <H1 style = "color:#0000A0;" align=center ><font size="6"> 神思第二代身份证验证系统——支持U口/串口</font></H1>
  3. <style type="text/css">
  4. <!--
  5. .STYLE1{
  6. font-family:"方正宋体-人口信息";}
  7. .S1 {
  8. width:1002px;
  9. margin:0 auto;
  10. color:#01c;
  11. border:0;}
  12. .S1 table{
  13. border:1px solid #707070;}
  14. -->
  15. </style>
  16. <HR><center>
  17. <OBJECT
  18. classid="clsid:F1317711-6BDE-4658-ABAA-39E31D3704D3"
  19. width=390
  20. height=300
  21. align=center
  22. hspace=0
  23. vspace=0
  24. id=idcard
  25. name=rdcard
  26. >
  27. </OBJECT>
  28. <body onbeforeunload="Unload()" >
  29. <table width="680" border="0">
  30. <tr>
  31. <td><input type="button" value="打开机具" style="width:140px;" name="myopen" onclick="myopen_onclick()" /></td>
  32. <td><input type="button" value="关闭机具" style="width:140px;" name="myclose" onclick="myclose_onclick()" /></td>
  33. <td><input type="button" value="开始读卡" style="width:140px;" name="beginread" onClick="beginread_onclick()"/></td>
  34. <td><input type="button" value="等待读卡" style="width:140px;" name="read3" onclick="read3_onclick()" /></td>
  35. <td><input type="button" value="停止读卡" style="width:140px;" name="endread" onclick="endread_onclick()" /></td>
  36. </tr>
  37. <tr>
  38. <td><input type="button" value="手动读卡" style="width:140px;" name="handread" onclick="handread_onclick()"/></td>
  39. <td><input type="button" value="保存身份证图片" style="width:140px;" name="SaveCard" onclick="SaveCard_onclick()"/></td>
  40. <td><input type="button" value="读设备模块号" style="width:140px;" name="ReadsNum" onclick="ReadsNum_onclick()"/></td>
  41. <td><input type="button" value="设置文件路径" style="width:140px;" name="savepath" onclick="savepath_onclick()"/></td>
  42. <td><input type="button" value="清空所有属性" style="width:140px;" name="MyClear" onClick="MyClear_onclick()"/></td>
  43. </tr>
  44. </table>
  45. <form name=tcard>
  46. <table class="s1" >
  47. <tr>
  48. <td width="12%" ><IMG height=126 alt="" width=102 border=0 name=photo id=jpgfile style="left:10px;"></td>
  49. <td>
  50. <table width="820" border="1" style="color:#0011CC" >
  51. <tr>
  52. <td align="right">提示信息</td>
  53. <td><input name="tResult" type="text" size="40" /></td>
  54. <td align="right">设备模块号</td>
  55. <td><input name="tsNum" type="text" size="40" /></td>
  56. </tr>
  57. <tr>
  58. <td align="right">证件类型标识</td>
  59. <td><input name="tCardType" type="text" size="40" /></td>
  60. <td align="right">证件类型</td>
  61. <td><input name="tCardT" type="text" size="40" /></td>
  62. </tr>
  63. <tr>
  64. <td align="right">姓名name</td>
  65. <td><input name="tName" type="text" size="40" /></td>
  66. <td align="right">姓名nameL</td>
  67. <td><input name="tNameL" type="text" size="40" /></td>
  68. </tr>
  69. <tr>
  70. <td align="right">性别sex</td>
  71. <td><input name="tSex" type="text" size="40" /></td>
  72. <td align="right">性别sexL</td>
  73. <td><input name="tSexL" type="text" size="40" /></td>
  74. </tr>
  75. <tr>
  76. <td align="right">民族nation</td>
  77. <td><input name="tFolk" type="text" size="40" /></td>
  78. <td align="right">民族nationL</td>
  79. <td><input name="tFolkL" type="text" size="40" /></td>
  80. </tr>
  81. <tr>
  82. <td align="right">出生Born</td>
  83. <td><input name="tBirth" type="text" size="40" /></td>
  84. <td align="right">出生BornL</td>
  85. <td><input name="tBirthL" type="text" size="40" /></td>
  86. </tr>
  87. <tr>
  88. <td align="right">公民身份号码</td>
  89. <td><input name="tcardID" type="text" size="40" /></td>
  90. <td align="right">住 址</td>
  91. <td><input name="tAddr" type="text" size="40" /></td>
  92. </tr>
  93. <tr>
  94. <td align="right">最新住址</td>
  95. <td><input name="tnewAddr" type="text" size="40" /></td>
  96. <td align="right">签发机关</td>
  97. <td><input name="tIssue" type="text" size="40" /></td>
  98. </tr>
  99. <tr>
  100. <td align="right">有效期限</td>
  101. <td><input name="tBeginEnd" type="text" size="40" /></td>
  102. <td align="right">有效期限L</td>
  103. <td><input name="tBeginEndL" type="text" size="40" /></td>
  104. </tr>
  105. <tr>
  106. <td align="right">通行证号码</td>
  107. <td><input name="tPassPortId" type="text" size="40" /></td>
  108. <td align="right">签发次数</td>
  109. <td><input name="tSignCount" type="text" size="40" /></td>
  110. </tr>
  111. <tr>
  112. <td align="right">头像JPG</td>
  113. <td><input name="jbuff" type="text" size="40" /></td>
  114. <td align="right">头像BMP</td>
  115. <td><input name="bbuff" type="text" size="40" /></td>
  116. </tr>
  117. <tr>
  118. <td align="right">头像JPGroot</td>
  119. <td><input name="jroot" type="text" size="40" /></td>
  120. <td align="right">头像BMProot</td>
  121. <td><input name="broot" type="text" size="40" /></td>
  122. </tr>
  123. <tr>
  124. <td align="right">指纹特征值1</td>
  125. <td><input name="Fchar1" type="text" size="40" /></td>
  126. <td align="right">指纹特征值2</td>
  127. <td><input name="Fchar2" type="text" size="40" /></td>
  128. </tr>
  129. <tr>
  130. <td align="right">指位信息1</td>
  131. <td><input name="FNUM1" type="text" size="40" /></td>
  132. <td align="right">指位信息2</td>
  133. <td><input name="FNUM2" type="text" size="40" /></td>
  134. </tr>
  135. <tr>
  136. <td align="right">指纹质量1</td>
  137. <td><input name="Fzl1" type="text" size="40" /></td>
  138. <td align="right">指纹质量2</td>
  139. <td><input name="Fzl2" type="text" size="40" /></td>
  140. </tr>
  141. <tr>
  142. <td align="right">指纹注册结果1</td>
  143. <td><input name="Fzhuce1" type="text" size="40" /></td>
  144. <td align="right">指纹注册结果2</td>
  145. <td><input name="Fzhuce2" type="text" size="40" /></td>
  146. </tr>
  147. </table>
  148. </td>
  149. </tr>
  150. </table>
  151.  
  152. </form>
  153. </body>
  154.  
  155. <script for=idcard event="Readed()">
  156. //alert(\'Readed\');
  157. var ss;
  158. getinfo_onclick();
  159. </script>
  160.  
  161. <script for=idcard event="Closed()">
  162. //window.close();
  163. </script>
  164.  
  165. <script for=idcard event="Opened()">
  166. //window.close();
  167. </script>
  168.  
  169. <SCRIPT>
  170.  
  171.  
  172. function SaveCard_onclick(){
  173. var pp
  174. if(ss=="J")
  175. {
  176. document.getElementsByName("tResult")[0].value="港澳台居民居住证暂不支持保存正反面照片";
  177. return;
  178. }
  179. pp = rdcard.ExportBMP("D:\\");
  180. if(pp==0)
  181. {
  182. document.getElementsByName("tResult")[0].value="保存成功";
  183. }
  184. else
  185. {
  186. document.getElementsByName("tResult")[0].value="保存失败: "+pp;
  187. }
  188. }
  189. function myopen_onclick(){
  190. var pp ;
  191. pp=rdcard.openport();
  192. //alert(pp);
  193. if(pp==0)
  194. {
  195. document.getElementsByName("tResult")[0].value="openport成功";
  196. }
  197. else
  198. {
  199. document.getElementsByName("tResult")[0].value="openport失败: "+pp;
  200. }
  201. }
  202. function myclose_onclick(){
  203. var pp
  204. pp=rdcard.closeport();
  205. if(pp==0)
  206. {
  207. document.getElementsByName("tResult")[0].value="closeport成功";
  208. }
  209. else
  210. {
  211. document.getElementsByName("tResult")[0].value="closeport失败: "+pp;
  212. }
  213. }
  214. function Unload(){
  215. MyClose_onclick();
  216. //alert("Page is Close");
  217. }
  218. function endread_onclick(){
  219. var pp
  220. pp=rdcard.endread();
  221. if(pp==0)
  222. {
  223. document.getElementsByName("tResult")[0].value="endread成功";
  224. }
  225. else
  226. {
  227. document.getElementsByName("tResult")[0].value="endread失败: "+pp;
  228. }
  229. }
  230. function handread_onclick(){
  231. var pp
  232. pp=rdcard.readcard();
  233. if(pp==0)
  234. {
  235. document.getElementsByName("tResult")[0].value="readcard成功";
  236. //showjpg_onclick();
  237. }
  238. else
  239. {
  240. document.getElementsByName("tResult")[0].value="readcard失败: "+pp;
  241. }
  242. }
  243. function beginread_onclick(){
  244. var pp
  245. pp=rdcard.ReadCard2();
  246. if(pp==0)
  247. {
  248. document.getElementsByName("tResult")[0].value="ReadCard2成功";
  249. }
  250. else
  251. {
  252. document.getElementsByName("tResult")[0].value="ReadCard2失败: "+pp;
  253. }
  254. }
  255. function read3_onclick(){
  256. var pp
  257. pp=rdcard.ReadCard3();
  258. if(pp==0)
  259. {
  260. document.getElementsByName("tResult")[0].value="ReadCard3成功";
  261. }
  262. else
  263. {
  264. document.getElementsByName("tResult")[0].value="ReadCard3失败: "+pp;
  265. }
  266. }
  267. function ReadsNum_onclick(){
  268. var pp
  269. pp = rdcard.ReadSecurityNum();
  270. if(pp==0)
  271. {
  272. document.getElementsByName("tsNum")[0].value=rdcard.SecurityNum;
  273. document.getElementsByName("tResult")[0].value=rdcard.sResultMsg;
  274. }
  275. else
  276. {
  277. document.getElementsByName("tsNum")[0].value="读模块号码失败";
  278. document.getElementsByName("tResult")[0].value="读模块号码失败: "+pp;
  279. }
  280. }
  281. function showjpgIE6(){
  282. //alert(\'读照片成功\');
  283. document.getElementsByName("photo")[0].src = "file:///C|/null.JPEG";
  284. if(rdcard.PhotoPath == "")
  285. document.getElementsByName("photo")[0].src = "file:///C|/null.JPEG";
  286. else
  287. document.getElementsByName("photo")[0].src = rdcard.PhotoPath ;
  288. }
  289. function showjpgIE8(){
  290. //alert(\'读照片成功\');
  291. document.all[\'photo\'].src = \'data:image/jpeg;base64,\' + rdcard.JPGBuffer;
  292. }
  293. function getinfo_onclick(){
  294. var r1,r2;
  295. document.getElementsByName("tName")[0].value=rdcard.NameS;
  296. document.getElementsByName("tNameL")[0].value=rdcard.NameL;
  297. document.getElementsByName("tSex")[0].value=rdcard.Sex;
  298. document.getElementsByName("tSexL")[0].value=rdcard.SexL;
  299. document.getElementsByName("tFolk")[0].value=rdcard.Nation;
  300. document.getElementsByName("tFolkL")[0].value=rdcard.NationL;
  301. document.getElementsByName("tBirth")[0].value=rdcard.Born;
  302. document.getElementsByName("tBirthL")[0].value=rdcard.BornL;
  303. document.getElementsByName("tcardID")[0].value=rdcard.CardNo;
  304. document.getElementsByName("tAddr")[0].value=rdcard.Address;
  305. document.getElementsByName("tnewAddr")[0].value=rdcard.newAddress;
  306. document.getElementsByName("tIssue")[0].value =rdcard.Police;
  307. document.getElementsByName("tBeginEnd")[0].value=rdcard.Activity;
  308. document.getElementsByName("tBeginEndL")[0].value = rdcard.ActivityL;
  309. document.getElementsByName("tPassPortId")[0].value = rdcard.PassPortId;
  310. document.getElementsByName("tSignCount")[0].value = rdcard.SignCount;
  311. document.getElementsByName("jroot")[0].value=rdcard.JPGfile;
  312. document.getElementsByName("broot")[0].value=rdcard.BMPfile;
  313. document.getElementsByName("jbuff")[0].value=rdcard.JPGBuffer;
  314. document.getElementsByName("bbuff")[0].value=rdcard.BMPBuffer;
  315. document.getElementsByName("Fchar1")[0].value=rdcard.FGchar1;
  316. document.getElementsByName("Fchar2")[0].value=rdcard.FGchar2;
  317. document.getElementsByName("tCardType")[0].value=rdcard.CardType;
  318. if(rdcard.bHaveCard == "1")
  319. {
  320. if(rdcard.CardType == "I")
  321. {
  322. document.getElementsByName("tCardT")[0].value="外国人永久居留证";
  323. ss=rdcard.CardType;
  324. }
  325. else if (rdcard.CardType == "J") {
  326. document.getElementsByName("tCardT")[0].value = "港澳台居民居住证";
  327. ss=rdcard.CardType;
  328. }
  329. else
  330. {
  331. document.getElementsByName("tCardT")[0].value="二代身份证";
  332. ss=rdcard.CardType;
  333. }
  334. }
  335. else
  336. {
  337. document.getElementsByName("tCardT")[0].value="";
  338. ss=rdcard.CardType;
  339. }
  340. r1 = rdcard.FGNUM1;
  341. r2 = rdcard.FGNUM2;
  342. switch(r1)
  343. {
  344. case 11:
  345. document.getElementsByName("FNUM1")[0].value="右手拇指";
  346. break;
  347. case 12:
  348. document.getElementsByName("FNUM1")[0].value="右手食指";
  349. break;
  350. case 13:
  351. document.getElementsByName("FNUM1")[0].value="右手中指";
  352. break;
  353. case 14:
  354. document.getElementsByName("FNUM1")[0].value="右手环指";
  355. break;
  356. case 15:
  357. document.getElementsByName("FNUM1")[0].value="右手小指";
  358. break;
  359. case 16:
  360. document.getElementsByName("FNUM1")[0].value="左手拇指";
  361. break;
  362. case 17:
  363. document.getElementsByName("FNUM1")[0].value="左手食指";
  364. break;
  365. case 18:
  366. document.getElementsByName("FNUM1")[0].value="左手中指";
  367. break;
  368. case 19:
  369. document.getElementsByName("FNUM1")[0].value="左手环指";
  370. break;
  371. case 20:
  372. document.getElementsByName("FNUM1")[0].value="左手小指";
  373. break;
  374. default:
  375. document.getElementsByName("FNUM1")[0].value="";
  376. }
  377. switch(r2)
  378. {
  379. case 11:
  380. document.getElementsByName("FNUM2")[0].value="右手拇指";
  381. break;
  382. case 12:
  383. document.getElementsByName("FNUM2")[0].value="右手食指";
  384. break;
  385. case 13:
  386. document.getElementsByName("FNUM2")[0].value="右手中指";
  387. break;
  388. case 14:
  389. document.getElementsByName("FNUM2")[0].value="右手环指";
  390. break;
  391. case 15:
  392. document.getElementsByName("FNUM2")[0].value="右手小指";
  393. break;
  394. case 16:
  395. document.getElementsByName("FNUM2")[0].value="左手拇指";
  396. break;
  397. case 17:
  398. document.getElementsByName("FNUM2")[0].value="左手食指";
  399. break;
  400. case 18:
  401. document.getElementsByName("FNUM2")[0].value="左手中指";
  402. break;
  403. case 19:
  404. document.getElementsByName("FNUM2")[0].value="左手环指";
  405. break;
  406. case 20:
  407. document.getElementsByName("FNUM2")[0].value="左手小指";
  408. break;
  409. default:
  410. document.getElementsByName("FNUM2")[0].value="";
  411. }
  412. r1 = rdcard.FGQualityScore1;
  413. r2 = rdcard.FGQualityScore2;
  414. if(r1 == 0)
  415. document.getElementsByName("Fzl1")[0].value="";
  416. else
  417. document.getElementsByName("Fzl1")[0].value=rdcard.FGQualityScore1;
  418. if(r2 == 0)
  419. document.getElementsByName("Fzl2")[0].value="";
  420. else
  421. document.getElementsByName("Fzl2")[0].value=rdcard.FGQualityScore2;
  422. r1 = rdcard.FGRegistry1;
  423. r2 = rdcard.FGRegistry2;
  424. switch(r1)
  425. {
  426. case 1:
  427. document.getElementsByName("Fzhuce1")[0].value="注册成功";
  428. break;
  429. case 2:
  430. document.getElementsByName("Fzhuce1")[0].value="注册失败";
  431. break;
  432. case 3:
  433. document.getElementsByName("Fzhuce1")[0].value="未注册";
  434. break;
  435. case 9:
  436. document.getElementsByName("Fzhuce1")[0].value="未知";
  437. break;
  438. default:
  439. document.getElementsByName("Fzhuce1")[0].value="";
  440. }
  441. switch(r2)
  442. {
  443. case 1:
  444. document.getElementsByName("Fzhuce2")[0].value="注册成功";
  445. break;
  446. case 2:
  447. document.getElementsByName("Fzhuce2")[0].value="注册失败";
  448. break;
  449. case 3:
  450. document.getElementsByName("Fzhuce2")[0].value="未注册";
  451. break;
  452. case 9:
  453. document.getElementsByName("Fzhuce2")[0].value="未知";
  454. break;
  455. default:
  456. document.getElementsByName("Fzhuce2")[0].value="";
  457. }
  458. document.getElementsByName("tResult")[0].value=idcard.sResultMsg;
  459. document.all[\'photo\'].src = \'data:image/jpeg;base64,\' + rdcard.JPGBuffer;
  460. }
  461. function savepath_onclick(){
  462. rdcard.strSavePath= "c:\\aa";
  463. document.getElementsByName("tResult")[0].value="路径设置成功";
  464. }
  465. function MyClear_onclick(){
  466. var pp
  467. pp = rdcard.ClearAll();
  468. getinfo_onclick();
  469. document.getElementsByName("tsNum")[0].value="";
  470. if(pp==0)
  471. {
  472. document.getElementsByName("tResult")[0].value="清空成功";
  473. }
  474. else
  475. {
  476. document.getElementsByName("tResult")[0].value="清空失败: "+pp;
  477. }
  478. }
  479. function window_onUnload(){
  480. rdcard.DeleteOutputFile();
  481. rdcard.DeleteAllPicture();
  482. }
  483. </SCRIPT>
  484. </HTML>

 

版权声明:本文为Vinkong原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/Vinkong/p/12509227.html