{快速拷贝文件的方法}
Procedure CopyFile(SourceFile, DestFile: String);
var
sf, df: TFileStream;
begin
sf := TFileStream.create(SourceFile, fmOpenRead); //创建源文件流
try
df := TFileStream.create(DestFile, fmCreate or fmOpenWrite);
try
df.CopyFrom(sf, sf.size);
finally
FreeAndNil(df);
end;
Finally
FreeAndNil(sf);
End;
end;
调用这个过程:
CopyFile('C:/1.txt', 'D:/2.txt');