應用函數開發包含下列文件:
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>
/// <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);