Delphi 7 - Decode Base64 String to Byte Array

匿名 (未验证) 提交于 2019-12-03 02:31:01

问题:

I am making a builder/stub application. The builder is coded in XE2 while the stub is coded in Delphi 7.

In XE2 when I use "EncdDecd" it has functions to encode EncodeBase64 and DecodeBase64. But in Delphi 7 when I use EncdDecd it does not have the DecodeBase64 function that I need.

In my builder I am loading a file into a stream and encoding it to a B64 AnsiString and adding it to the resources of the stub. The goal is to have the stub decode this B64 AnsiString into a byte array and ultimately write it to a file on the disk.

回答1:

All versions of Delphi from v6 onward ship with Indy preinstalled. Its IdCoderMIME unit has TIdEncoderMIME and TIdDecoderMIME classes for encoding/decoding base64 content.



回答2:

There is plenty of base64 free Delphi code that you can use. TurboPower LockBox 3 also has an implementation of base64. This is compilable in Delphi 7.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!