读卡器如何和delphi相连
想问下大家,我读卡器是接打印机接口的,怎么可以和我写的delphi程序相连接啊,
帮忙了,3Q先
procedure TForm1.FormCreate(Sender: TObject);
begin
str:='';
mscomm1.PortOpen:=true;
end;
procedure TForm1.MSComm1Comm(Sender: TObject);
begin
if MSComm1.CommEvent=ComEvReceive then
begin
str:=str+MSComm1.Input;
if copy(str,length(str),1)=chr(3) then
begin
memo1.Text:=copy(str,1,length(str)-1);
str:='';
end;
end;
end;
这样可以吗?谢谢大家乐