怎样遍历一目录树并将其子目录及文件拷贝到另一地方 如题,如有代码请贴出来或发我E-mail:[email protected],万分感激…………………………………………………………………………………… 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://expert.csdn.net/Expert/topic/2095/2095217.xml?temp=.6852533 只知道单文件拷贝,如果有多遍历一目录树并将其子目录及文件拷贝到另一地方的程序,给我也发一份,My_email : [email protected],感谢! //复制目录树procedure copydirectorytree(ahandle:THandle;const aFromDirectory,aToDirectory:string);var shfileopstruct:TSHFileOpStruct; fromdir:pchar; todir:pchar;begin getmem(fromdir,length(afromdirectory)+2); try getmem(todir,length(atodirectory)+2); try fillchar(fromdir^,length(afromdirectory)+2,0); fillchar(todir^,length(atodirectory)+2,0); strcopy(fromdir,pchar(afromdirectory)); strcopy(todir,pchar(atodirectory)); with shfileopstruct do begin wnd:=ahandle; wfunc:=fo_copy; pfrom:=fromdir; pto:=todir; fflags:=fof_noconfirmation;// or fof_renameoncollision; fanyoperationsaborted:=false; hnamemappings:=nil; if shfileoperation(shfileopstruct)<>0 then raiselastwin32error; end; finally freemem(todir,length(atodirectory)+2); end; finally freemem(fromdir,length(afromdirectory)+2); end; end; 求助使Tchart的Y轴显示2个不同的区间 反编译 怎么样将widestring类型的数据直接存放在字付串中? SQL Server提示’将截断字符串或二进制数据‘!! 请教一个自定义控件的属性问题! 各位瞧瞧这个软件,请提宝贵意见 麻烦各位大侠帮我看看dbgrid多选问题,100分,不够再加,感激涕零! 如何動態創建一個三層的菜單? WebService的CGI Error 如何修改系统的日期格式? 求‘点数字’游戏源代码=^_^= 在程序中用OLEvariant变量如何设置Excel某个单元自动换行?
procedure copydirectorytree(ahandle:THandle;const aFromDirectory,aToDirectory:string);
var shfileopstruct:TSHFileOpStruct;
fromdir:pchar;
todir:pchar;
begin
getmem(fromdir,length(afromdirectory)+2);
try
getmem(todir,length(atodirectory)+2);
try fillchar(fromdir^,length(afromdirectory)+2,0);
fillchar(todir^,length(atodirectory)+2,0); strcopy(fromdir,pchar(afromdirectory));
strcopy(todir,pchar(atodirectory)); with shfileopstruct do
begin
wnd:=ahandle;
wfunc:=fo_copy;
pfrom:=fromdir;
pto:=todir;
fflags:=fof_noconfirmation;// or fof_renameoncollision;
fanyoperationsaborted:=false;
hnamemappings:=nil;
if shfileoperation(shfileopstruct)<>0 then raiselastwin32error;
end;
finally
freemem(todir,length(atodirectory)+2);
end;
finally
freemem(fromdir,length(afromdirectory)+2);
end;
end;