zoukankan      html  css  js  c++  java
  • 身份证读卡设备-华视电子

    操作顺序:

    • 打开设备
    • 卡认证
    • 读卡

    调用sdk的方法读卡等。

    读卡

    while (true)// 
    {
        if (bgw.CancellationPending)//
        {
            e.Cancel = true; //
            return;
        }
        int authenticate = CVRSDK.CVR_Authenticate();
        if (authenticate == 1)
        { 
            int readContent = CVRSDK.CVR_Read_FPContent();  
            if (readContent != 1)
            { 
                bgw.ReportProgress(100, "读卡失败");
                Thread.Sleep(TimeSpan.FromSeconds(1));//
                continue;
            } 
        }
        else
        {
            Thread.Sleep(TimeSpan.FromSeconds(1));//
            continue;
        } 
     
        int length = 0; 
        byte[] name = new byte[128];
        length = 128;
        CVRSDK.GetPeopleName(ref name[0], ref length);//姓名
        string nameStr = Encoding.GetEncoding("GB2312").GetString(name);
        //
        byte[] number = new byte[128];
        length = 128;
        CVRSDK.GetPeopleIDCode(ref number[0], ref length);//身份证号码
        string cardNoStr = Encoding.GetEncoding("GB2312").GetString(number);
        //
        string IsReadCardAddress = mesh.common.SystemSetting.GetSetting("IsReadCardAddress"); 
        byte[] address = new byte[128];
        length = 128;
        CVRSDK.GetPeopleAddress(ref address[0], ref length);//地址
        string addressStr = Encoding.GetEncoding("GB2312").GetString(address); 
        //
        bgw.ReportProgress(50, new object[] { nameStr, addressStr, cardNoStr });
        Thread.Sleep(TimeSpan.FromSeconds(3)); //
    }
    

    作者:马洪彪  Q我
    出处:http://www.cnblogs.com/mahongbiao/
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

  • 相关阅读:
    Android常见问题——找不到HttpClient和okHttp的包
    linux大文件的日志查询
    ubuntu ssh连不上
    linux查询核数
    ubuntu系统安装手动分区
    计算服务器带宽
    linux命令
    打包jar 运行
    打印pdf
    运行 jar 包
  • 原文地址:https://www.cnblogs.com/mahongbiao/p/14626629.html
Copyright © 2011-2022 走看看