Home > Back-end >  Talent, can turn thinking recognizer Delphi code in C Builder
Talent, can turn thinking recognizer Delphi code in C Builder

Time:09-24

The Function UCommand1 (pCmd: PByte; Parg0 parg1, parg2: Pint) : integer; Stdcall; Far; External 'RdCard. DLL';//
The Function GetAddr (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
The Function GetBegin (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
The Function GetName (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
The Function GetSex (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
The Function GetFolk (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
The Function GetIDNum (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
The Function GetDep (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
The Function GetBirth (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
The Function GetEnd (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
The Function GetNewAddr (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
//Function GetSexGB (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
//Function GetFolkGB (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
The Function GetSAMIDToStr (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
The Function GetErrString (eNum: integer; Buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';
The Function GetSamID (buf: pchar) : integer; Stdcall; Far; External 'RdCard. DLL';

{procedure TForm1. Timer1Timer (Sender: TObject);
Var
Info: an array of BYTE [0.. 255].
UniData: an array of BYTE [1.. 256].
Ss, ss1: string;
HFile: THandle;//file handle
NRead: DWORD;//read bytes
I, j: integer;

The rect: Trect;

CMD: BYTE;
Para0 para1, para2: integer;
The begin
If not bRun then
The begin
//
Timer1. Enabled:=False;
Try
CMD:=$43;
Para0:=1;
Para1:=strtoint (Edit1. Text);
Para2:=strtoint (Edit2. Text);
NRet:=UCommand1 (@ CMD, @ para0 @ para1, @ para2);
If nRet=62171 then
The begin
//remove information display
//verification card success
//read the basic information
CMD:=$44.
Para0:=1;
Para1:=strtoint (Edit1. Text);
//para2:=strtoint (Edit2. Text);
Ss:=ExtractFilePath (Application. ExeName) + 'tt';
//para2=@ ss;
NRet:=UCommand1 (@ CMD, @ para0 @ para1, Pint (ss));
If (nRet=62171) or (nRet=62172) then
The begin
BRead:=True;
If nRet=62172 then
The begin
Zhiwen. Text:='fingerprint data:' '+ ss +' fp. Bin ';
End
The else
The begin
Zhiwen. Text:='no fingerprint data;
end;

The begin
//Showmessage (' file into success! ');
//========================================
J:=0;
//the Name
For I:=1 to 30 do
The begin
UniData [I] :=info [j + I - 1);
end;
EsName. Caption:=trim (WideCharLenToString (PWideChar (@ uniData), 15));
//Sex
J:=30;
For I:=1 to 2 do
The begin
UniData [I] :=info [j + I - 1);
end;
EsSex. Caption:=trim (WideCharLenToString (PWideChar (@ uniData), 1));
If esSex. Caption='1' then
EsSex. Caption:='male'
The else
EsSex. Caption:='female';

//Folk
J:=32;
For I:=1 to 4 do
The begin
UniData [I] :=info [j + I - 1);
end;
EsFolk. Caption:=trim (WideCharLenToString (PWideChar (@ uniData), 2));
EsFolk. Caption:=FOLK [strtoint (esFolk. Caption)];
//BirthDay
J:=36;
For I:=1 to 16 do
The begin
UniData [I] :=info [j + I - 1);
end;
EsBirth. Caption:=trim (WideCharLenToString (PWideChar (@ uniData), 8));
//Addr
J:=52;
For I:=1 to 70 do
The begin
UniData [I] :=info [j + I - 1);
end;
EsAddr. Caption:=trim (WideCharLenToString (PWideChar (@ uniData), 35));
//ID
J:=122;
For I:=1 to 36 do
The begin
UniData [I] :=info [j + I - 1);
end;
EsID. Caption:=trim (WideCharLenToString (PWideChar (@ uniData), 18));
//Issue
J:=158;
For I:=1 to 30 do
The begin
UniData [I] :=info [j + I - 1);
end;
EsIssue. Caption:=trim (WideCharLenToString (PWideChar (@ uniData), 15));
//IssueBegin
J:=188;
For I:=1 to 16 do
The begin
UniData [I] :=info [j + I - 1);
end;
EsBegin. Caption:=trim (WideCharLenToString (PWideChar (@ uniData), 8));
//IssueEnd
J:=204;
For I:=1 to 16 do
The begin
UniData [I] :=info [j + I - 1);
end;
EsEnd. Caption:=trim (WideCharLenToString (PWideChar (@ uniData), 8));
{j:=220;
For I:=1 to 70 do
The begin
UniData [I] :=info [j + I - 1);
end;
}
Try
Ss1:=ss + 'zp. BMP';
Image1. Picture. Bitmap. LoadFromFile (ss1).
Except,
end;
//WinExec (

end;
Procedure TForm1. BitBtn2Click (Sender: TObject);
Var
CMD: BYTE;
Para0 para1, para2: integer;
The begin
If not Timer1. Enabled then
The begin
CMD:=$41.//open the serial port
Para0:=0;//automatic search port
Para1:=strtoint (Edit1. Text);
Para2:=strtoint (Edit2. Text);
NRet:=UCommand1 (@ CMD, @ para0 @ para1, @ para2);
//if (nRet=62171) OR (nRet=5) OR (nRet=7) then
If (nRet=62171) then
The begin
Timer1. Enabled:=True;
end;
If not Timer1. Enabled then
EsEnd. Caption:='Return:' + inttostr (nRet);
End
The else
The begin
Timer1. Enabled:=False;
CMD:=$42.//close port
Para0:=0; nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull