最近的项目中用到读卡器,用的华视身份证阅读器,附上SDK使用手册

来源:互联网 发布:淘宝数据魔方免费版 编辑:程序博客网 时间:2024/05/21 09:57
<script type="text/javascript" src="http://cbjs.baidu.com/js/o.js"></script>
最近的项目中用到读卡器,用的华视身份证阅读器,附上SDK使用手册
1.定义
应用函数开发包含下列文件:

termb.dll      API函数的动态联接库
sdtapi.dll     内部动态库
cvrapi.dll      内部动态库
wltrs.dll       内部动态库
termb.lic      身份证相片解压授权文件,放于C:\目录下

2.       函数列表

下面这5个为主要的API

int CVR_InitComm(int Port)                            初始化连接;
int CVR_Authenticate()                                  卡认证;
int CVR_Read_Content(int Active)                   读卡操作;
int CVR_CloseComm()                                   关闭连接;
int CVR_Ant(int mode)                                   射频操作,仅串口有效

下面的为可选API,主要为二次开发使用

int  CVR_ReadBaseMsg (unsigned char *pucCHMsg, unsigned int *puiCHMsgLen,unsigned char *pucPHMsg, unsigned int *puiPHMsgLen,int nMode)                                                                    读卡操作(读入内存)
int  GetPeopleName(char *strTmp, int *strLen)            得到姓名信息
int  GetPeopleSex(char *strTmp, int *strLen)               得到性别信息  
int  GetPeopleNation(char *strTmp, int *strLen)           得到民族信息   
int  GetPeopleBirthday(char *strTmp, int *strLen)        得到出生日期   
int  GetPeopleAddress(char *strTmp, int *strLen)        得到地址信息   
int  GetPeopleIDCode(char *strTmp, int *strLen)         得到身份证号信息
int  GetDepartment(char *strTmp, int *strLen)            得到发证机关信息
int  GetStartDate(char *strTmp, int *strLen)               得到有效开始日期     
int  GetEndDate(char *strTmp, int *strLen)                 得到有效截止日期

3.部份代码

         ///   <summary>
        
///  初始化设备
        
///   </summary>
        
///   <param name="port"></param>
        
///   <returns></returns>
        [DllImport( " termb.dll ", CharSet = CharSet.Auto)]
         private  static  extern  int CVR_InitComm( int port);

         ///   <summary>
        
///  关闭设备
        
///   </summary>
        
///   <returns></returns>
        [DllImport( " termb.dll ", CharSet = CharSet.Auto)]
         private  static  extern  int CVR_CloseComm();

         ///   <summary>
        
///  卡与身份证认证
        
///   </summary>
        
///   <returns></returns>
        [DllImport( " termb.dll ", CharSet = CharSet.Auto)]
         private  static  extern  int CVR_Authenticate();

         ///   <summary>
        
///  读取内容
        
///   </summary>
        
///   <param name="active"></param>
        
///   <returns></returns>
        [DllImport( " termb.dll ", CharSet = CharSet.Auto)]
         private  static  extern  int CVR_Read_Content( int active);
<script type="text/javascript" src="http://cbjs.baidu.com/js/o.js"></script>
<script type="text/javascript" src="http://cbjs.baidu.com/js/o.js"></script>

<script type="text/javascript"><!--google_ad_client = "ca-pub-1944176156128447";/* cnblogs 首页横幅 */google_ad_slot = "5419468456";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击