hab sowas mal für *.txt gemacht und die in einem memo anzeigen lassen
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var s : String;
i : Integer;
begin
memo2.Clear;
s:=memo1.Text;
for i:=1 to length(s) do
s[i]:=char(23 Xor Ord(s[i]));
memo2.Text:=s;
memo1.Clear;
end;
procedure TForm1.Button2Click(Sender: TObject);
var s : String;
i,k : Integer;
f:Textfile;
begin
AssignFile(f,ExtractFilePath(Application.ExeName)+'\dekod.ini');
if FileExists(ExtractFilePath(Application.ExeName)+'\dekod.ini') = False
then Rewrite(f)
else Append(f);
memo1.Clear;
k:=0;
s:=memo2.text;
for i:=1 to length(s) do
begin
s[i]:=char(23 Xor ord(s[i]));
if (ord(s[i])=13) or(ord(s[i])=10) or(ord(s[i])=29) or(ord(s[i])=26)//in [(char(32))..(char(255))]
then
begin
k:=k+1;
if k=2 then
begin
k:=0;
writeln(f,'');
end;
end
else write(f,s[i]);
end;
closefile(f);
memo1.lines.LoadFromFile(ExtractFilePath(Application.ExeName)+'dekod.ini');
memo2.Clear;
end;