function strtoascii(inputAnsi:string): string;
//字符串转换为ascii值,转换值是一个各单独值相加后的结果
var
i :integer;
Ansitemp,OutPutAnsi:STRING;
begin
OutPutAnsi:='';
For i:=0 To Length(inputAnsi) Do
begin
Ansitemp :=INTTOhex(ord(inputAnsi[i]),2);
OutPutAnsi := OutPutAnsi+Ansitemp;
end;
Result:= OutPutAnsi;
end;
procedure TForm3.Button1Click(Sender: TObject);
begin
edit1.Text:=strtoascii('闽abcd1234');
end;
end.
//字符串转换为ascii值,转换值是一个各单独值相加后的结果
var
i :integer;
Ansitemp,OutPutAnsi:STRING;
begin
OutPutAnsi:='';
For i:=0 To Length(inputAnsi) Do
begin
Ansitemp :=INTTOhex(ord(inputAnsi[i]),2);
OutPutAnsi := OutPutAnsi+Ansitemp;
end;
Result:= OutPutAnsi;
end;
procedure TForm3.Button1Click(Sender: TObject);
begin
edit1.Text:=strtoascii('闽abcd1234');
end;
end.