//lpFn: 文件名;<br>//能获得包括大于 4G 的文件大小.<br>function GetFileBytes(lpFn: PChar): Int64;<br>var<br> hFile, dwSizeLow, dwSizeHigh: Longword;<br>begin<br> Result := -1;<br> hFile := CreateFile(lpFn, GENERIC_READ, FILE_SHARE_READ, nil, OPEN_ALWAYS,<br> FILE_ATTRIBUTE_NORMAL, 0);<br> try<br> if hFile &lt;&gt; INVALID_HANDLE_VALUE then<br> begin<br> dwSizeLow := GetFileSize(hFile, @dwSizeHigh);<br> Result := dwSizeHigh*4294967296 + dwSizeLow;<br> end;<br> finally<br> CloseHandle(hFile);<br> end;<br>end;