Y
yanyading
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button2Click(Sender: TObject);
var
S: TFileStream;
T: TFileStream;
begin
S := TFileStream.Create('c:/tt.txt', fmOpenRead);
// Memo1.Lines.LoadFromStream(S); // 这段代码如果运行了,T.CopyFrom就无法读了
try
T := TFileStream.Create('c:/tb.txt', fmOpenWrite or fmCreate);
try
T.CopyFrom(S, S.Size);
finally
T.Free;
end
finally
S.Free;
end;
其实可能已经解决了,我加了一段 S.Position := 0, 对么?