一个简单的问题急呀在线等

knightknight 2004-01-15 03:54:41
function tform1.addtofile(sourcefile,targetfile:string):boolean;
var
target,source:tfilestream;
myfilesize:integer;
begin
try
source:=tfilestream.Create(sourcefile,fmopenread or fmshareexclusive);
target:=tfilestream.Create(targetfile,fmopenwrite or fmshareexclusive);
try
target.Seek(0,sofromend);
target.CopyFrom(source,0);
myfilesize:=source.Size+sizeof(myfilesize);
target.WriteBuffer(myfilesize,sizeof(myfilesize));
finally
target.Free;
source.Free;
end;
except
result:=false;
exit;
end;
result:=true;
end;
我在BUTTON的CLICK事件调用此涵数
if(addtofile('d:\111\project1.exe','d:\444\project1.exe')) then
showmessage('yes')
else
showmessage('no');
结果提示对话框‘YES’,我想问我怎样查找到添加'd:\444\project1.exe'此文件的'd:\111\project1.exe'的内容呀急呀
...全文
77 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
knightknight 2004-01-15
  • 打赏
  • 举报
回复
不明白你们的意思我的意思是现在程序没有问题我想问的'd:\111\project1.exe'被添加到'd:\444\project1.exe'文件怎样才能在'd:\444\project1.exe'文件中看到我所添加的的文件的内容呀
goldendays 2004-01-15
  • 打赏
  • 举报
回复
好像target.CopyFrom(source,0);有点问题
goldendays 2004-01-15
  • 打赏
  • 举报
回复
用ultraEdit吧

5,939

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧