for i := 1 to Length(str) do buf[i] := Ord(str[i]);
那如何还原回来呢?把buf[]中的内容还原回str
for i := 1 to 10 do str := str + chr(buf[i]);
楼主有点懒哦!要学着习惯有问题找帮助Returns the character for a specified ASCII value. UnitSystemCategorycharacter manipulation routinesDelphi syntax:function Chr(X: Byte): Char;DescriptionChr returns the character with the ordinal value (ASCII value) of the byte-type expression, X.------------------------------------------------------ Returns the ordinal value of an ordinal-type expression.UnitSystemCategoryordinal routinesDelphi syntax:function Ord(X);DescriptionX is a Delphi ordinal-type expression. The result is the ordinal position of X; its type is the smallest standard integer type that can hold all values of X's type.Ord cannot operate on Int64 values.
buf[i] := Ord(str[i]);
str := str + chr(buf[i]);
Returns the ordinal value of an ordinal-type expression.UnitSystemCategoryordinal routinesDelphi syntax:function Ord(X);DescriptionX is a Delphi ordinal-type expression. The result is the ordinal position of X; its type is the smallest standard integer type that can hold all values of X's type.Ord cannot operate on Int64 values.