这是一个文件拷贝
var
source,target:tfilestream;
begin
source:=tfilestream.Create(edit1.Text,fmopenread);
try
target:=tfilestream.Create(edit2.Text,fmopenwrite or fmcreate);
try
if target.CopyFrom(source,source.Size)=source.Size then
showmessage('ok');
finally
target.Free;
end;
finally
source.Free;
end;
end;