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;

New: System.NetEncoding
posted on 2009-11-13 16:15  万一  阅读(18641)  评论(22编辑  收藏  举报