Delphi 的编码与解码(或叫加密与解密)函数


EncdDecd 单元: EncodeString、DecodeString、EncodeBase64、DecodeBase64
uses EncdDecd;

const str = '万一的 Delphi 博客';

procedure TForm1.Button1Click(Sender: TObject);
var
  strEncode,strDecode: string;
begin
  strEncode := EncodeString(str);
  strDecode := DecodeString(strEncode);
  ShowMessageFmt('%s'#10#13'%s', [strEncode, strDecode]);
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  strEncode,strDecode: string;
begin
  strEncode := EncodeBase64(BytesOf(str), Length(BytesOf(str)));
  strDecode := StringOf(DecodeBase64(strEncode));
  ShowMessageFmt('%s'#10#13'%s', [strEncode, strDecode]);
end;

 
 
 
 
 

 

 
  

你可能感兴趣的:(Delphi 的编码与解码(或叫加密与解密)函数)