| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4059 人关注过本帖
标题:身份证识别仪读信息正常,但无法获取数据,怎么办?
只看楼主 加入收藏
hyswcyh01
Rank: 2
等 级:论坛游民
帖 子:64
专家分:47
注 册:2016-7-17
结帖率:100%
收藏
已结贴  问题点数:10 回复次数:6 
身份证识别仪读信息正常,但无法获取数据,怎么办?
如题,程序如入:
程序代码:
iscard=CVR_Authenticate()
cReadvalue=CVR_Read_Content(1)
DECLARE integer GetPeopleName in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetPeopleSex in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetPeopleNation in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetPeopleBirthday in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetPeopleAddress in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetPeopleIDCode in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetDepartment in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetStartDate in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetEndDate in termb.dll String @strTmp, Integer @strLen
strTmp = Space(255)
GetPeopleName(strTmp,strLen)
cName=strTmp
strTmp = Space(255)
GetPeopleSex(strTmp,strLen)
cSex=strTmp
strTmp = Space(255)
GetPeopleNation(strTmp,strLen)
cNation=strTmp
strTmp = Space(255)
GetPeopleBirthday(strTmp,strLen)
cBirthday=strTmp
strTmp = Space(255)
GetPeopleAddress(strTmp,strLen)
cAddress=strTmp
strTmp = Space(255)
GetPeopleIDCode(strTmp,strLen)    
cIDCode=strTmp
strTmp = Space(255)
GetDepartment(strTmp,strLen)
cDepartment=strTmp
strTmp = Space(255)
GetStartDate(strTmp,strLen)
cStartDate=strTmp
strTmp = Space(255)
GetEndDate(strTmp,strLen)
cEndDate=strTmp
cMessage='姓名:'+cName+chr(13)+'性别:'+cSex+chr(13)+ '民族:'+cNation+chr(13)+ '日期:'+cBirthday+chr(13)+ '地址:'+cAddress+chr(13)+ '身份证号:'+cIDCode+chr(13)+ '发证机关:'+cDepartment+chr(13)+ '有效期始:'+cStartDate+chr(13)+ '有效期止:'+cEndDate+chr(13)
thisform.edit1.value=cMessage
thisform.image1.picture='zp.bmp'

前面都正常,
图片附件: 游客没有浏览图片的权限,请 登录注册
这里不能显示了,怎么了?
深圳华视,CVR-100U

[此贴子已经被作者于2016-8-5 13:23编辑过]

搜索更多相关主题的帖子: 身份证 color 信息 
2016-08-05 12:23
sdta
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:江苏省连云港市
等 级:版主
威 望:335
帖 子:9821
专家分:27099
注 册:2012-2-5
收藏
得分:0 
以下是引用hyswcyh01在2016-8-5 12:23:13的发言:

如果,程序如入:
iscard=CVR_Authenticate()
cReadvalue=CVR_Read_Content(1)
DECLARE integer GetPeopleName in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetPeopleSex in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetPeopleNation in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetPeopleBirthday in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetPeopleAddress in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetPeopleIDCode in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetDepartment in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetStartDate in termb.dll String @strTmp, Integer @strLen
DECLARE integer GetEndDate in termb.dll String @strTmp, Integer @strLen
strTmp = Space(255)
GetPeopleName(strTmp,strLen)
cName=strTmp
strTmp = Space(255)
GetPeopleSex(strTmp,strLen)
cSex=strTmp
strTmp = Space(255)
GetPeopleNation(strTmp,strLen)
cNation=strTmp
strTmp = Space(255)
GetPeopleBirthday(strTmp,strLen)
cBirthday=strTmp
strTmp = Space(255)
GetPeopleAddress(strTmp,strLen)
cAddress=strTmp
strTmp = Space(255)
GetPeopleIDCode(strTmp,strLen)   
cIDCode=strTmp
strTmp = Space(255)
GetDepartment(strTmp,strLen)
cDepartment=strTmp
strTmp = Space(255)
GetStartDate(strTmp,strLen)
cStartDate=strTmp
strTmp = Space(255)
GetEndDate(strTmp,strLen)
cEndDate=strTmp
cMessage='姓名:'+cName+chr(13)+'性别:'+cSex+chr(13)+ '民族:'+cNation+chr(13)+ '日期:'+cBirthday+chr(13)+ '地址:'+cAddress+chr(13)+ '身份证号:'+cIDCode+chr(13)+ '发证机关:'+cDepartment+chr(13)+ '有效期始:'+cStartDate+chr(13)+ '有效期止:'+cEndDate+chr(13)
thisform.edit1.value=cMessage
thisform.image1.picture='zp.bmp'
前面都正常,这里不能显示了,怎么了?
深圳华视,100U

'这里'指的是那里,看不明白。

坚守VFP最后的阵地
2016-08-05 13:07
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10567
专家分:43011
注 册:2014-5-20
收藏
得分:10 
调用函数的参数类型要与声明类型要一致,如:
DECLARE integer GetPeopleName in termb.dll String @strTmp, Integer @strLen
参数 strTmp, strLen 是IN/OUT参数,最好这样调用GetPeopleName()
strTmp = Space(255)
strLen = ... &&提供的代码没看到有这个
GetPeopleName(@strTmp, @strLen)
2016-08-05 14:51
hyswcyh01
Rank: 2
等 级:论坛游民
帖 子:64
专家分:47
注 册:2016-7-17
收藏
得分:0 
程序代码:
    读各项文字信息到自定义内存缓冲
原  型:
    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)            //得到有效截止日期
int  CVR_GetSAMID(char * SAMID)             //得到安全模块号码
参数:
       *strTmp   返回的信息缓存指针。
       *strLen    返回的信息长度指针。


这是SDK说明

程序代码:
Private Sub Command8_Click()
    Dim strTemp As String
    Dim nReturnLen As Integer
    Dim nReturn As Integer
    
    strTemp = Space(255)
    nReturn = GetPeopleAddress(strTemp, nReturnLen)
    
    List1.AddItem "【读取地址】"
    List1.AddItem " 地址: " & strTemp
End Sub

这是VB里的代码,可以返回数据,我的VF不能。

与VB的代码区别是:
VB里:
图片附件: 游客没有浏览图片的权限,请 登录注册

定义了全局变量,而VF的方式不一样。不知道怎么处理。

[此贴子已经被作者于2016-8-5 15:25编辑过]

2016-08-05 15:21
hyswcyh01
Rank: 2
等 级:论坛游民
帖 子:64
专家分:47
注 册:2016-7-17
收藏
得分:0 
以下是引用吹水佬在2016-8-5 14:51:35的发言:

调用函数的参数类型要与声明类型要一致,如:
DECLARE integer GetPeopleName in termb.dll String @strTmp, Integer @strLen
参数 strTmp, strLen 是IN/OUT参数,最好这样调用GetPeopleName()
strTmp = Space(255)
strLen = ... &&提供的代码没看到有这个
GetPeopleName(@strTmp, @strLen)


在调用函数之前加:
STORE "" TO strTemp
STORE 0 TO strLen

可以吗?
2016-08-05 15:30
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10567
专家分:43011
注 册:2014-5-20
收藏
得分:0 
原型 int GetPeopleName(char *strTmp, int *strLen)

DECLARE integer GetPeopleName in termb.dll String @strTmp, Integer @strLen
函数声明没错,参数 strTmp, strLen 是IN/OUT参数
strTmp = Space(255)
strLen = 0 && 看似是输出strTmp的有效长度
nRet = GetPeopleName(@strTmp, @strLen)
还有个数值型返回值,可以观测一下。
? nRet
? strLen
? LEFT(strTmp, strLen)

[此贴子已经被作者于2016-8-5 16:45编辑过]

2016-08-05 16:43
hyswcyh01
Rank: 2
等 级:论坛游民
帖 子:64
专家分:47
注 册:2016-7-17
收藏
得分:0 
谢谢版主!
解决了!可以读到了!谢谢 吹水佬 !
GetPeopleName(@strTemp,@nReturnLen)


是我的问题,函数中少了@,低级错误!

[此贴子已经被作者于2016-8-6 16:32编辑过]

2016-08-06 16:29
快速回复:身份证识别仪读信息正常,但无法获取数据,怎么办?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023478 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved