Function XStr( Source : String ) : String; Var I : Integer; Begin Result := ''; For I := 1 To Length( Source ) Do Begin Result := Result + IntToHex( Ord( Source[ I ] ) ); End; End;
procedure TForm1.Button2Click(Sender: TObject); Var s,r:string; i:integer; begin s:=Edit2.Text; r:=''; for i:=1 to Length(s) do r:=r+ IntTostr(Ord(s[i])); edit3.Text :=r; end;
上面是输出16进制的格式!!! 这是输出10进制的格式!!!Function XStr( Source : String ) : String; Var I : Integer; Begin Result := ''; For I := 1 To Length( Source ) Do Begin Result := Result + IntToStr( Ord( Source[ I ] ) ); End; End;
Var
I : Integer;
Begin
Result := '';
For I := 1 To Length( Source ) Do
Begin
Result := Result + IntToHex( Ord( Source[ I ] ) );
End;
End;
Var s,r:string;
i:integer;
begin
s:=Edit2.Text;
r:='';
for i:=1 to Length(s) do
r:=r+ IntTostr(Ord(s[i]));
edit3.Text :=r;
end;
这是输出10进制的格式!!!Function XStr( Source : String ) : String;
Var
I : Integer;
Begin
Result := '';
For I := 1 To Length( Source ) Do
Begin
Result := Result + IntToStr( Ord( Source[ I ] ) );
End;
End;