本文整理自网络,侵删。
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 “invalid floating point operation.”错误的解决方法
Delphi idhttpserver接收http get请求解码问题
Delphi f1026 file not found: ''quickrpt.dcu''解决方法
Delphi api: setwindowpos改变窗口的位置与状态
更多相关阅读请进入《Delphi》频道 >>