(code, 1, 2) + ''0000'';
index := codeTst.IndexOf(code);
if index = -1 then
begin
Result := st;
exit;
end;
st := infoTst[index] + st; //省
Result := st;
end;
var
YLYear, YLMonth, YlDay, id, sex, code: string;
E: integer;
St: string;
begin
e := Length(identitycode);
if (e <> 18) or (e <> 15) then result := '''';
if (e = 18) then
begin
YLYear := copy(identitycode, 7, 4);
YlMonth := copy(identitycode, 11, 2);
YLday := copy(identitycode, 13, 2);
id := copy(identitycode, 18,1);
end;
if (e = 15) then
begin
YLYear := ''19'' + copy(identitycode, 7, 2);
YlMonth := copy(identitycode, 9, 2);
YLday := copy(identitycode, 11, 2);
id := copy(identitycode, 15, 1);
end;
st := '''';
if IsDate(YlYear, YlMonth, Ylday) then
begin
st := YLYear + ''年'' + YlMonth + ''月'' + YLday + ''日生''
end;
code := copy(identitycode, 1, 6);
st := getdetailedFromCode(code) + '':'' + st;
if (StrToInt(id) mod 2 = 1) then
begin
sex := ''男'';
end
else
begin
sex := ''女'';
end;
st := st + '':'' + sex + ''性!'' + Trim(IntToStr(e)) + ''位证号!'';
Result := st;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i, num: integer;
code, info: string;
begin
codeInfoTst := Tstringlist.Create;
CodeTst := Tstringlist.Create;
infotst := Tstringlist.Create;
try
codeInfoTst.LoadFromFile(''c:\co