No.1 用二进制字段类型//不建议No.2 再转换成可视字符串(如:十六进制)//建议

解决方案 »

  1.   

    //提供两个函数给你,不要钱!
    function HexToStr(mHex: string): string;
    var
      I: Integer;
    begin
      Result := '';
      for I := 1 to Length(mHex) div 2 do
        Result := Result + Chr(StrToIntDef('$' + mHex[I * 2 - 1] + mHex[I * 2], 0));
    end; { HexToStr }function StrToHex(mStr: string): string;
    var
      I: Integer;
    begin
      Result := '';
      for I := 1 to Length(mStr) do
        Result := Format('%s%.2x', [Result, Ord(mStr[I])]);
    end; { StrToHex }
      

  2.   

    //提供两个函数给你,不要钱!
    function HexToStr(mHex: string): string;
    var
      I: Integer;
    begin
      Result := '';
      for I := 1 to Length(mHex) div 2 do
        Result := Result + Chr(StrToIntDef('$' + mHex[I * 2 - 1] + mHex[I * 2], 0));
    end; { HexToStr }function StrToHex(mStr: string): string;
    var
      I: Integer;
    begin
      Result := '';
      for I := 1 to Length(mStr) do
        Result := Format('%s%.2x', [Result, Ord(mStr[I])]);
    end; { StrToHex }
      

  3.   

    zswang(伴水)(* pascal→c *) :
       这样能原样取出来减密吗?