//Utf8ToAnsi
// 获取文件内容
function getFileText(fileName: string): string;
var
s: string;
tt: TMemoryStream;
i: Integer;
Filebuf: array of pchar;
begin
if not FileExists(fileName) then
begin
Result := '';
Exit;
end;
i := 0;
tt := TMemoryStream.Create;
tt.LoadFromFile(fileName);
i := tt.Size;
SetLength(Filebuf, i);
tt.ReadBuffer(Filebuf[0], i);
s := StrPas(@Filebuf[0]);
//s := Utf8ToAnsi(s);
result := s;
end;
Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号
执行时间: 0.046732187271118 seconds