function GetFileText(const FileName: string): string;
var
hFile: DWORD;
iSize: DWORD;
sTemp: string;
begin
hFile := CreateFile(PChar(FileName), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
iSize := GetFileSize(hFile, nil);
SetLength(sTemp, iSize + 2);
ReadFile(hFile, sTemp[1], iSize, iSize, nil);
CloseHandle(hFile);
sTemp[iSize + 1] := #0;
sTemp[iSize + 2] := #0;
if (sTemp[1] = #$FF) and (sTemp[2] = #$FE) then // UNICODE
begin
SetLength(Result, iSize);
WideCharToMultiByte(CP_ACP, 0, PWideChar(@sTemp[3]), -1, @Result[1], iSize, nil, nil);
end else
Result := sTemp;
Result := string(PChar(Result));
end;