F: file;
Size: Integer;
Buffer: PChar;
begin
AssignFile(F, 'test.txt');//test.txt是你的文本文件
Reset(F, 1);
try
Size := FileSize(F);
GetMem(Buffer, Size);
try
BlockRead(F, Buffer^, Size);
memo1.text:=buffer;
finally
FreeMem(Buffer);
end;
finally
CloseFile(F);
end;
end;