IC卡,能读出数据,但写入数据时总是出错!什么缘故?(卡是Simen4442) ( 积分: 100 )

  • 主题发起人 主题发起人 wu7509
  • 开始时间 开始时间
因为错误计数为0,证明卡已经坏了,所以:
"校验密码"中功能我随便输入什么密码,它都显示“验证密码成功"
用张好卡测试:
先校验密码再写数据.
 
VB的接口是这样写的,DELPHI不知道怎么写?

Declare Function rdstr_4442 Lib "yjrdic.dll" (ByVal icaddr As Byte, ByVal offset As Integer, ByVal le As Integer, ByRef data_buffer As Byte) As Integer
Declare Function check_4442 Lib "yjrdic.dll" (ByVal icaddr As Byte) As Integer

Declare Function wrstr_4442 Lib "yjrdic.dll" (ByVal icaddr As Byte, ByVal offset As Integer, ByVal le As Integer, ByVal data_buffer$) As Integer
Declare Function wrstr_4442_hex Lib "yjrdic.dll" Alias "wrstr_4442" (ByVal icaddr As Byte, ByVal offset As Integer, ByVal le As Integer, ByRef data_buffer As Byte) As Integer

Declare Function rdpb_4442 Lib "yjrdic.dll" (ByVal le As Integer, ByVal data_buffer$) As Integer
Declare Function wrpb_4442 Lib "yjrdic.dll" (ByVal offset As Integer, ByVal le As Integer, ByVal data_buffer$) As Integer

Declare Function ckey_4442 Lib "yjrdic.dll" (ByVal icaddr As Byte, ByVal le As Integer, ByRef data_buffer As Byte) As Integer
Declare Function mkey_4442 Lib "yjrdic.dll" (ByVal icaddr As Byte, ByVal le As Integer, ByRef data_buffer As Byte) As Integer
Declare Function rkey_4442 Lib "yjrdic.dll" (ByVal icaddr As Byte, ByVal le As Integer, ByRef data_buffer As Byte) As Integer
Declare Function rkeyc_4442 Lib "yjrdic.dll" (ByVal icaddr As Byte, counter As Integer) As Integer

Declare Function asc_hex Lib "yjrdic.dll" (ByVal asc$, ByRef hex As Byte, ByVal le&) As Integer
Declare Function hex_asc Lib "yjrdic.dll" (ByRef hex As Byte, ByVal asc$, ByVal le&) As Integer
Declare Function asc_asc% Lib "yjrdic.dll" (ByRef des As Byte, ByVal sorc$, ByVal le&)
 
uses windows;

function wrstr_4442_hex(icaddr : BYTE; offset : Integer; le : Integer; data_buffer : PBYTE) : Integer;stdcall;external 'YJRDIC.DLL' name 'wrstr_4442';

调用
====
DataBuffer : array[0..3] of BYTE;

DataBuffer[0] := $C1;
DataBuffer[1] := $C1;
DataBuffer[2] := $C1;
DataBuffer[3] := $C1;

wrstr_4442(1, 0 + 2 * 32, sizeof(DataBuffer), PBYTE(@DataBuffer));
 
最好把C的原型贴上来。
 
供应商提供的程序太简单了,什么也没说明!
st = wrstr_4428(icaddr, Val(Text5.Text), Len(Text6.Text), Text6.Text)
If st = 0 Then
List1.AddItem ("写卡成功")
Else
List1.AddItem ("写错误!")
End If
相关的只有这么几句程序!

我现在只有先去搞张新卡试试再说了
 
你用的是杭州的产品么?
 
分分了,谢谢大家!
 
后退
顶部