代碼: 選擇全部
function CopyFileTo(const Source, Destination: string): Boolean;
var
SourceStream: TFileStream;
begin
result := false;
if not FileExists(Destination) then
begin
SourceStream := TFileStream.Create(Source, fmOpenRead);
try
with TFileStream.Create(Destination, fmCreate) do
try
CopyFrom(SourceStream, 0);
finally free;
end;
finally SourceStream.free;
end;
result := true;
end;
end;