7,763
社区成员
发帖
与我相关
我的任务
分享
Private Declare Function ICC_read_bin Lib "crwicc.dll" (ByVal fd As Long, ByVal offSet As Long, ByVal leng As Long, ByVal ReadDate As String) As Long
Sub ReadData()
Dim lRet As Long
Dim strBuffer As String
strBuffer = String(100, vbNullChar)
lRet = ICC_read_bin(hPort, 64, Len(strBuffer), strBuffer)
If Hex(lRet) <> 9000 Then
MsgBox "对IC卡读取数据失败,检查IC卡是否损毁"
Else
strBuffer = Left(strBuffer, InStr(strBuffer, vbNullChar) - 1)
MsgBox strBuffer
MsgBox Left(Trim(strBuffer), 4)
End If
End Sub
ReadDate = ""
readIC = ICC_read_bin(hPort, 64, 15, ReadDate)
If Hex(readIC) <> 9000 Then
MsgBox "对IC卡读取数据失败,检查IC卡是否损毁"
Else
MsgBox ReadDate
MsgBox Left(Trim(StrConv(ReadDate,vbUnicode)), 4) '要进行一次转换
End If