Ich denke, so sollte es klappen. Code ungeprüft, Rest selber machen:
Delphi-Quellcode:
procedure ReadText(AFileName : String);
var FStream : TFileStream;
SStream : TStringStream;
s : String;
begin
s := '';
FStream := TFileStream.Create(AFileName);
SStream := TStringStream.Create(s);
try
FStream.Position := 0;
SStream.CopyFrom(FStream, FStream.Size);
SStream.Position := 0;
s := SStream.ReadString(SStream.Size);
s := StringReplace(s, #0, '', rfReplaceAll);
Memo1.Text := s;
finally
FreeAndNil(FStream);
FreeAndNil(SStream);
end;
end;
Gruß oki