大致是sdtapi.dll 先打开端口,图1这个
然后用termb.dll 读取数据,图2这几个函数.
可能还有其它的伴随动作,具体要查他给的说明才行.
否则这些函数有哪些参数都不知道,你也无法正确的调用.
先默认这些函数都是无参数的吧,先试了再说.
[此贴子已经被作者于2021-4-22 10:03编辑过]
[此贴子已经被作者于2021-4-22 10:20编辑过]
CLEAR CLEAR ALL cDefPath = ADDBS(JUSTPATH(SYS(16))) SET DEFAULT TO (cDefPath) #DEFINE COM1 1 #DEFINE COM2 2 #DEFINE COM3 3 #DEFINE COM4 4 #DEFINE USB1 1001 #DEFINE USB2 1002 #DEFINE USB3 1003 #DEFINE USB4 1004 DECLARE LONG CVR_InitComm IN termb.dll LONG && 初始化连接 DECLARE LONG CVR_Authenticate IN termb.dll && 卡认证 DECLARE LONG CVR_Read_Content IN termb.dll LONG && 读卡操作 DECLARE LONG CVR_CloseComm IN termb.dll && 关闭连接; DECLARE LONG CVR_GetSAMID IN termb.dll STRING@ && 得到安全模块号 DECLARE LONG GetPeopleName IN termb.dll STRING@,LONG@ && 得到姓名信息 DECLARE LONG GetPeopleSex IN termb.dll STRING@,LONG@ && 得到性别信息 DECLARE LONG GetPeopleNation IN termb.dll STRING@,LONG@ && 得到民族信息 DECLARE LONG GetPeopleBirthday IN termb.dll STRING@,LONG@ && 得到出生日期 DECLARE LONG GetPeopleAddress IN termb.dll STRING@,LONG@ && 得到地址信息 DECLARE LONG GetPeopleIDCode IN termb.dll STRING@,LONG@ && 身份证号信息 DECLARE LONG GetDepartment IN termb.dll STRING@,LONG@ && 得到发证机关信息 DECLARE LONG GetStartDate IN termb.dll STRING@,LONG@ && 得到有效开始日期 DECLARE LONG GetEndDate IN termb.dll STRING@,LONG@ && 得到有效截止日期 ret = CVR_InitComm(USB1) && 假设用USB1口连接设备 IF ret != 1 ? IIF(ret==0, "动态库加载失败", "端口打开失败") *RETURN ENDIF ret = CVR_Authenticate() IF ret != 1 ? ICASE(ret==2,"寻卡失败", ret==3,"选卡失败", "初始化失败") *RETURN ENDIF ret = CVR_Read_Content(0) IF ret != 1 ? IIF(ret==0, "错误", "异常") *RETURN ENDIF cBuf = SPACE(256) nLen = 0 GetPeopleName(@cBuf, @nLen) ? "姓名", LEFT(cBuf, nLen) GetPeopleSex(@cBuf, @nLen) ? "性别", LEFT(cBuf, nLen) GetPeopleNation(@cBuf, @nLen) ? "民族", LEFT(cBuf, nLen) GetPeopleBirthday(@cBuf, @nLen) ? "出生日期", LEFT(cBuf, nLen) GetPeopleAddress(@cBuf, @nLen) ? "地址", LEFT(cBuf, nLen) GetPeopleIDCode(@cBuf, @nLen) ? "卡号", LEFT(cBuf, nLen) GetDepartment(@cBuf, @nLen) ? "发证机关", LEFT(cBuf, nLen) GetStartDate(@cBuf, @nLen) ? "有效开始日期", LEFT(cBuf, nLen) GetEndDate(@cBuf, @nLen) ? "有效截止日期", LEFT(cBuf, nLen) ** 或者读 wz.txt ** 张红叶 ** 女 ** 汉 ** 1988-11-18 ** 河北省邯郸市临漳县称勾镇称勾东村复兴路25号 ** 130423198811184328 ** 临漳县公安局 ** 2011.03.30-2021.03.30 IF ALINES(arr,FILETOSTR("wz.txt")) < 8 ? "wz.txt 文件无效" ENDIF ? "姓名", arr[1] ? "性别", arr[2] ? "民族", arr[3] ? "出生日期", arr[4] ? "地址", arr[5] ? "卡号", arr[6] ? "发证机关", arr[7] ? "有效日期", arr[8] CVR_CloseComm()