Foxtable(狐表)用户栏目专家坐堂 → [求助]身份证读卡器连接


  共有4081人关注过本帖树形打印复制链接

主题:[求助]身份证读卡器连接

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110792 积分:563898 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/3/27 9:09:00 [显示全部帖子]

把HSCertInfo.dll、SSSE32.dll、UnPack.dll、HSCertInfo.lib复制到foxtable的安装目录里

全局代码
Public Declare Function ReadCertInfo Lib "HSCertInfo.dll" Alias "ReadCertInfo" (pBmpFile As String , pName As StringBuilder, pSex As StringBuilder, pNation As StringBuilder, pBirth As StringBuilder, pAddress As StringBuilder, pCertNo As StringBuilder, pDepartment As StringBuilder, pEffectData As StringBuilder, pExpire As StringBuilder, pErrMsg As StringBuilder) As Integer 

调用
Dim pName As  New StringBuilder(1024)
Dim pSex As  New StringBuilder(1024)
Dim pNation As  New StringBuilder(1024)
Dim pBirth As  New StringBuilder(1024)
Dim pAddress As  New StringBuilder(1024)
Dim pCertNo As  New StringBuilder(1024)
Dim pDepartment As  New StringBuilder(1024)
Dim pEffectData As  New StringBuilder(1024)
Dim pExpire As  New StringBuilder(1024)
Dim pErrMsg As  New StringBuilder(1024)
Dim ret = CertInfoHelper.ReadCertInfo(ProjectPath & "temp.bmp", pName, pSex, pNation,pBirth,pAddress, pCertNo, pDepartment, pEffectData, pExpire, pErrMsg)
If ret = 0 Then
    Output.Show("姓名.Text =" & pName.ToString())
    Output.Show("性别.Text =" &  pSex.ToString())
    Output.Show("民族.Text =" &  pNation.ToString())
    Output.Show("出生日期.Text =" &  pBirth.ToString())
    Output.Show("家庭住址.Text =" &  pAddress.ToString())
    Output.Show("身份证号.Text =" &  pCertNo.ToString())
    Output.Show("发证机关.Text =" &  pDepartment.ToString())
    Output.Show("发证日期.Text =" &  pEffectData.ToString())
    Output.Show("有效日期.Text =" &  pExpire.ToString())
    Output.Show("图片路径=" & ProjectPath & "temp.bmp")
Else
    MessageBox.Show(ret.ToString() + pErrMsg.ToString())
End If

c#代码转换为vb.net:https://converter.telerik.com/
[此贴子已经被作者于2020/3/30 11:43:18编辑过]

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110792 积分:563898 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/3/30 11:08:00 [显示全部帖子]

把项目复制到其他目录,注意项目所在的路径,项目的名称不能有括号等特殊字符。然后重新打开项目测试,看提示什么错误?

 回到顶部
帅哥,在线噢!
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110792 积分:563898 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/3/30 11:42:00 [显示全部帖子]

Dim pName As  New StringBuilder(1024)
Dim pSex As  New StringBuilder(1024)
Dim pNation As  New StringBuilder(1024)
Dim pBirth As  New StringBuilder(1024)
Dim pAddress As  New StringBuilder(1024)
Dim pCertNo As  New StringBuilder(1024)
Dim pDepartment As  New StringBuilder(1024)
Dim pEffectData As  New StringBuilder(1024)
Dim pExpire As  New StringBuilder(1024)
Dim pErrMsg As  New StringBuilder(1024)
Dim ret = CertInfoHelper.ReadCertInfo(ProjectPath & "temp.bmp", pName, pSex, pNation,pBirth,pAddress, pCertNo, pDepartment, pEffectData, pExpire, pErrMsg)
If ret = 0 Then
    Output.Show("姓名.Text =" & pName.ToString())
    Output.Show("性别.Text =" &  pSex.ToString())
    Output.Show("民族.Text =" &  pNation.ToString())
    Output.Show("出生日期.Text =" &  pBirth.ToString())
    Output.Show("家庭住址.Text =" &  pAddress.ToString())
    Output.Show("身份证号.Text =" &  pCertNo.ToString())
    Output.Show("发证机关.Text =" &  pDepartment.ToString())
    Output.Show("发证日期.Text =" &  pEffectData.ToString())
    Output.Show("有效日期.Text =" &  pExpire.ToString())
    Output.Show("图片路径=" & ProjectPath & "temp.bmp")
Else
    MessageBox.Show(ret.ToString() + pErrMsg.ToString())
End If
[此贴子已经被作者于2020/3/30 11:42:59编辑过]

 回到顶部
帅哥,在线噢!
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110792 积分:563898 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/3/30 12:03:00 [显示全部帖子]

CertInfoHelper.ReadCertInfo
改为
ReadCertInfo

 回到顶部