如何把某一目录中的几个文件拷贝到软盘上? 是这样吗?copy *.* a:. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我说的是在Delphi编程中,如何实现? 用API函数:copyfile或自己写程序:用两函数就可以解决了readblock()writeblock() 整个目录拷,可包含任意多级子目录: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; fFlags:=FOF_NOCONFIRMATION; fAnyOperationsAborted:=true; hNameMappings:=nil; lpszProgressTitle:=nil; if SHFileOperation(SHFileOpStruct)<>0 then RaiseLastWin32Error; end; finally FreeMem(ToDir,Length(AToDirectory)+2); end; finally FreeMem(FromDir,Length(AFromDirectory)+2); end;end; 怎样编写实现通过代理和远程服务器(TCP协议)通讯的客户端? TListBox中如何实现,下拉时不替换而是追加? 关于DBGrid的双击事件问题 请教:我想做个“个人财务软件”,可以有哪些适当的需求!谢谢! 求救,调用C++动态库的问题 。。。 HELP??。。。。有没有人清楚:X的Y次幂的算法,请指教?????? 我如何才能在下拉框里得到在此网内所有服务器的名称呀! 提个简单的问题,其实也不简单,我就不知道。 请踊跃发言,非常感谢。 字体问题?????????????????? 如何获取字符串指定位置后面的几个字符串 怎样将当前时间转换成一个长整型的数值
copyfile
或自己写程序:
用两函数就可以解决了
readblock()
writeblock()
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;
fFlags:=FOF_NOCONFIRMATION;
fAnyOperationsAborted:=true;
hNameMappings:=nil;
lpszProgressTitle:=nil;
if SHFileOperation(SHFileOpStruct)<>0 then
RaiseLastWin32Error;
end;
finally
FreeMem(ToDir,Length(AToDirectory)+2);
end;
finally
FreeMem(FromDir,Length(AFromDirectory)+2);
end;
end;