Falls ne, dann *tritt,fg*:
Delphi-Quellcode:
type TByteArr =
Array of Byte;
function ReadIn(
const Filename:
String ): TByteArr;
var
f:
File of Byte;
Err:
String;
begin
if not FileExists(Filename)
then
Exit;
{$i-}
AssignFile( F, Filename );
Reset( F );
SetLength( Result, FileSize(F) );
BlockRead( F, Result[0], Length(Result) );
CloseFile( F );
{i-}
Err := SysErrorMessage( IOResult );
if Err <> 0
then
MessageBoxA(
Handle, pChar( '
Error [' + IntToStr(IOResult) + '
]'#13#10#13#10+Err ),
'
Error', MB_OK
or MB_ICONERROR );
end;