Delphi 利用TmemoryStream写入数据到文本文件末尾前255字节 20
functionTFrm_LookPic.WritePra(_pra:string;info:string):Boolean;varMyFile:TMemoryStrea...
function TFrm_LookPic.WritePra(_pra:string;info:string):Boolean;
var
MyFile:TMemoryStream;
Bytes: array of pchar;
begin
try
MyFile:= TMemoryStream.Create;
MyFile.LoadFromFile(_pra);
SetLength(Bytes,255);
Bytes[0] := pchar(info);
MyFile.Seek(-255,soFromEnd);
MyFile.WriteBuffer(Bytes[0],255);
FreeAndNil(MyFile);
Result:= true;
except
on e:Exception do
begin
Result:= false;
end;
end;
谁能帮我看下,为什么写不进去呢?? 展开
var
MyFile:TMemoryStream;
Bytes: array of pchar;
begin
try
MyFile:= TMemoryStream.Create;
MyFile.LoadFromFile(_pra);
SetLength(Bytes,255);
Bytes[0] := pchar(info);
MyFile.Seek(-255,soFromEnd);
MyFile.WriteBuffer(Bytes[0],255);
FreeAndNil(MyFile);
Result:= true;
except
on e:Exception do
begin
Result:= false;
end;
end;
谁能帮我看下,为什么写不进去呢?? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询