procedure TForm1.Button1Click(Sender: TObject);
var
ArrayOfFile : array of char;
ArrayBound : Integer;
FileHandle : THandle;
begin
FileHandle := FileOpen('c:/a.bin', fmOpenReadWrite);
if FileHandle = 0 then
begin
ShowMessage('打开失败');
Exit;
end;
ArrayBound := GetFileSize(FileHandle, nil);
SetLength(ArrayOfFile, ArrayBound);
FileRead(FileHandle, ArrayOfFile[0], Length(ArrayOfFile));
FileClose(FileHandle);
end;