首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

请教有哪位高手用Delphi写过磁条卡写卡程序没有?如有请给一段代码

2012-03-23 
请问有谁用Delphi写过磁条卡写卡程序没有?如有请给一段代码。请问有谁用Delphi写过磁条卡写卡程序没有?如有

请问有谁用Delphi写过磁条卡写卡程序没有?如有请给一段代码。
请问有谁用Delphi写过磁条卡写卡程序没有?如有请给一段代码。如写卡时,读卡时的相关代码,不胜感谢!

[解决办法]
说明文档里写的已经是非常清楚了

程序中把dll文件声明于implementation中下面
function Rcard(rdata:pchar;track:integer):integer;stdcall;external 'JINCARD7.dll ';
function Wcard(wdata:pchar;track:integer):integer;stdcall;external 'JINCARD7.dll ';

//主程序 :

if 1 = Init_com( '1,9600,n,8,1 ') then //初始化端口成功
begin
if 1 = Rcard(rdata,5) then //调用库中的读函数,读二,三磁道,若成功则
begin
i:=pos ( 'a ',rdata);
strlcopy(str2,rdata,i-1); //拷贝磁道二中的内容于str2中
strcopy(str3,rdata+i); //拷贝磁道三中的内容于str3中
ShowMessage( '读卡成功! '); //显示读卡成功对话框
end;
wdata:= '2222222222a333333333 ';
if 1 = Wcard(wdata,5) then //调用库中的写函数进行写二,三磁道,若成功则
begin
ShowMessage( '写卡成功! '); //显示写卡成功对话框
end;
end; //根据Wcard函数所返回值判断写卡的状态

热点排行