• 新版本外国人永久居留身份证EST-100身份证阅读器接口更新


    以下是新版本外国人永久居留身份证读取C#代码:

    1. //身份证信息 *******************************************************************************************************
    2. private void button4_Click(object sender, EventArgs e)
    3. {
    4. if (FormIsOpenReader.IsOpenReader != 1)
    5. {
    6. richTextBox_idCard_data.Text += "EST-100身份证读卡器连接失败,请先打开设备 \r\n";
    7. return;
    8. }
    9. int t_nRe = 99;
    10. int t_nType = 1; //设置身份证读卡类型:0,文本信息;1,文本 + 照片;2,文本 + 照片 + 指纹,不读指纹读卡速度更快一些!
    11. StringBuilder t_szPicPath = new StringBuilder("IDphoto.jpg"); //定义相片名称
    12. StringBuilder t_arrChMsg = new StringBuilder(256);
    13. IDINFO idInfo = new IDINFO(); //结构体
    14. t_nRe = Donsee_ReadIDCard(t_nType, t_szPicPath, ref idInfo, t_arrChMsg); //注意结构体入参
    15. if (t_nRe == 0)
    16. {
    17. Donsee_Beep();
    18. if (idInfo.certType.ToString().Trim() == "I")//2017版外国人永居证
    19. {
    20. richTextBox_idCard_data.Text += "读取成功,证件类型:2017版外国人永居证\r\n";
    21. richTextBox_idCard_data.Text += "证件类型标识:" + idInfo.certType.ToString().Trim() + "\r\n";
    22. richTextBox_idCard_data.Text += "英文姓名:" + idInfo.ENfullname + "\r\n";
    23. richTextBox_idCard_data.Text += "性 别:" + idInfo.sex + "\r\n";
    24. richTextBox_idCard_data.Text += "永居证号码:" + idInfo.number + "\r\n";
    25. richTextBox_idCard_data.Text += "国籍:" + idInfo.people + idInfo.Nationality + "\r\n";
    26. richTextBox_idCard_data.Text += "中文姓名:" + idInfo.name + "\r\n";
    27. richTextBox_idCard_data.Text += "有效期开始:" + idInfo.signdate + "\r\n";
    28. richTextBox_idCard_data.Text += "有效期结束:" + idInfo.validterm + "\r\n";
    29. richTextBox_idCard_data.Text += "出生日期:" + idInfo.birthday + "\r\n";
    30. richTextBox_idCard_data.Text += "证件版本号:" + idInfo.certVersion + "\r\n";
    31. richTextBox_idCard_data.Text += "申请机关代码:" + idInfo.organs + "\r\n";
    32. if (t_nType != 0)
    33. {
    34. richTextBox_idCard_data.Text += "照片原始数据:" + idInfo.Photo.Substring(0, 50) + "..\r\n";
    35. }
    36. //外国人永居证没有指纹数据
    37. }
    38. else if (idInfo.certType.ToString().Trim() == "J")//港澳台居民居住证
    39. {
    40. richTextBox_idCard_data.Text += "读取成功,证件类型:港澳台通行证\r\n";
    41. richTextBox_idCard_data.Text += "证件类型标识:" + idInfo.certType.ToString().Trim() + "\r\n";
    42. richTextBox_idCard_data.Text += "姓名:" + idInfo.name + "\r\n";
    43. richTextBox_idCard_data.Text += "性别:" + idInfo.sex + "\r\n";
    44. richTextBox_idCard_data.Text += "出生日期:" + idInfo.birthday + "\r\n";
    45. richTextBox_idCard_data.Text += "地址:" + idInfo.address + "\r\n";
    46. richTextBox_idCard_data.Text += "港澳台居住证号码:" + idInfo.number + "\r\n";
    47. richTextBox_idCard_data.Text += "签发机关:" + idInfo.organs + "\r\n";
    48. richTextBox_idCard_data.Text += "有效期开始:" + idInfo.signdate + "\r\n";
    49. richTextBox_idCard_data.Text += "有效期结束:" + idInfo.validterm + "\r\n";
    50. richTextBox_idCard_data.Text += "通行证号码:" + idInfo.passNu + "\r\n";
    51. richTextBox_idCard_data.Text += "签发次数:" + idInfo.signCount + "\r\n";
    52. if (t_nType != 0)
    53. {
    54. richTextBox_idCard_data.Text += "照片原始数据:" + idInfo.Photo.Substring(0, 50) + "..\r\n";
    55. }
    56. if (t_nType == 2)
    57. {
    58. richTextBox_idCard_data.Text += "指纹原始数据:" + idInfo.figData.Substring(0, 50) + "..\r\n";
    59. }
    60. }
    61. else if (idInfo.certType.ToString().Trim() == "Y")//新版外国人永居证
    62. {
    63. richTextBox_idCard_data.Text += "读取成功,证件类型:新版外国人永居证\r\n";
    64. richTextBox_idCard_data.Text += "证件标识:" + idInfo.certType.ToString().Trim() + "\r\n";
    65. richTextBox_idCard_data.Text += "中文姓名:" + idInfo.name + "\r\n";
    66. richTextBox_idCard_data.Text += "性 别:" + idInfo.sex + "\r\n";
    67. richTextBox_idCard_data.Text += "换证次数:" + idInfo.certVersion + "\r\n";
    68. richTextBox_idCard_data.Text += "出生日期:" + idInfo.birthday + "\r\n";
    69. richTextBox_idCard_data.Text += "英文姓名:" + idInfo.ENfullname + " " +idInfo.Other + "\r\n"; //注意英文姓名,包括了备用,才是完整姓名
    70. richTextBox_idCard_data.Text += "证件号码:" + idInfo.number + "\r\n";
    71. richTextBox_idCard_data.Text += "有效期开始:" + idInfo.signdate + "\r\n";
    72. richTextBox_idCard_data.Text += "有效期结束:" + idInfo.validterm + "\r\n";
    73. richTextBox_idCard_data.Text += "国籍代码:" + idInfo.people + "/" + idInfo.Nationality + "\r\n";
    74. richTextBox_idCard_data.Text += "当次申请受理机构:" + idInfo.organs + "\r\n";
    75. if (idInfo.address=="")
    76. {
    77. richTextBox_idCard_data.Text += "既往版本永居证号码:无" + "\r\n";
    78. }
    79. else {
    80. richTextBox_idCard_data.Text += "既往版本永居证号码:" + idInfo.address + "\r\n";
    81. }
    82. if (t_nType != 0)
    83. {
    84. richTextBox_idCard_data.Text += "照片数据:" + idInfo.Photo.Substring(0, 50) + "..\r\n"; //原始数据2048字符,界面只显示50字符
    85. }
    86. }
    87. else //(idInfo.certType.ToString().Trim() == "0") //居民身份证
    88. {
    89. richTextBox_idCard_data.Text += "读取成功,证件类型:居民身份证\r\n";
    90. richTextBox_idCard_data.Text += "证件标识:" + idInfo.certType.ToString().Trim() + "\r\n";
    91. richTextBox_idCard_data.Text += "姓 名:" + idInfo.name + "\r\n";
    92. richTextBox_idCard_data.Text += "性 别:" + idInfo.sex + "\r\n";
    93. richTextBox_idCard_data.Text += "名 族:" + idInfo.people + "\r\n";
    94. richTextBox_idCard_data.Text += "出生日期:" + idInfo.birthday + "\r\n";
    95. richTextBox_idCard_data.Text += "住 址:" + idInfo.address + "\r\n";
    96. richTextBox_idCard_data.Text += "发证日期:" + idInfo.signdate + "\r\n";
    97. richTextBox_idCard_data.Text += "有效日期:" + idInfo.validterm + "\r\n";
    98. richTextBox_idCard_data.Text += "证件号码:" + idInfo.number + "\r\n";
    99. richTextBox_idCard_data.Text += "发证机关:" + idInfo.organs + "\r\n";
    100. richTextBox_idCard_data.Text += "其 他:" + idInfo.Other + "\r\n";
    101. if (t_nType != 0)
    102. {
    103. richTextBox_idCard_data.Text += "照片数据:" + idInfo.Photo.Substring(0, 50) + "..\r\n"; //原始数据2048字符,界面只显示50字符
    104. }
    105. if (t_nType == 2)
    106. {
    107. richTextBox_idCard_data.Text += "指纹数据:" + idInfo.figData.Substring(0, 50) + "..\r\n"; //原始数据2048字符,界面只显示50字符
    108. }
    109. }
    110. if (t_nType != 0) //显示照片文件
    111. {
    112. // pictureBox_idCard_photo.Image = Image.FromFile(t_szPicPath.ToString());
    113. // 显示照片,这个方法二次刷卡可能不显示照片,故改用下面方法来显示照片
    114. Image imgtmp = Image.FromFile(t_szPicPath.ToString());//这样做可以及时释放文件占用
    115. Bitmap img = new Bitmap(imgtmp);
    116. imgtmp.Dispose();
    117. pictureBox_idCard_photo.Image = img;
    118. }
    119. }
    120. else
    121. {
    122. richTextBox_idCard_data.Text += "身份证读取失败:"+ t_arrChMsg.ToString() + ",返回值:" + t_nRe + "\r\n";
    123. }
    124. }

  • 相关阅读:
    python经典百题之统计字符数
    向AI提问,我是怎么做的?
    mybatisPlus
    Android HIDL(1) ---- 概述
    端到端语音识别笔记
    供应叶酸PEG试剂Folic acid-PEG-Azide,FA-PEG-N3,叶酸-聚乙二醇-叠氮
    easyui datagrid单元格点击进入编辑时,行会自动向上错位
    Java - ScheduledExecutorService接口介绍(1)(可实现Timer定时器)
    [Docker]七.配置 Docker 网络
    flutter组件 InheritedWidget
  • 原文地址:https://blog.csdn.net/cntianya/article/details/133884392