如何将在TShellListView中选取的多个文件夹同时复制到一个目录!!谢谢!
解决方案 »
- delphi控件问题(求助)
- 如何读取XML文件中[CDATA[里面的内容
- 打开其他EXE文件出错!!!!!!
- 各位大位,能否告诉我从0到9,以及个分角元拾佰仟万各自的的Unicode编码吗???来者有分!!急,在线等!!!
- 怎样将工程中各窗体中caption为某一指定值的LABEL控件的值修改?
- 如何让我的DCOM程序成为windows的服务
- ActiveX是否可以和Servlet进行交互?
- 请问:如何将EXCEL文件的某个工作表另存为其他文件,谢谢
- delphi6的update1和update2有什么区别
- 答对着高分相送!!!!!
- 什么是分布式与三层结构?
- 小弟只剩最后19分啦,临死前只问最后一个问题:string最多只能存放255字节,若超过255字节用什么呢?
sToDirName:String):Boolean;
var
hFindFile:Cardinal;
t,tfile:String;
sCurDir:String[255];
FindFileData:WIN32_FIND_DATA;
begin
//先保存当前目录
sCurDir:=GetCurrentDir;
ChDir(sDirName);
hFindFile:=FindFirstFile('*.*',FindFileData);
if hFindFile< >INVALID_HANDLE_VALUE then
begin
if not DirectoryExists(sToDirName) then
ForceDirectories(sToDirName);
repeat
tfile:=FindFileData.cFileName;
if (tfile='.') or (tfile='..') then
Continue;
if FindFileData.dwFileAttributes=
FILE_ATTRIBUTE_DIRECTORY then
begin
t:=sToDirName+'\'+tfile;
if not DirectoryExists(t) then
ForceDirectories(t);
if sDirName[Length(sDirName)]< >'\' then
DoCopyDir(sDirName+'\'+tfile,t)
else
DoCopyDir(sDirName+tfile,sToDirName+tfile);
end
else
begin
t:=sToDirName+'\'+tFile;
CopyFile(PChar(tfile),PChar(t),True);
end;
until FindNextFile(hFindFile,FindFileData)=false;
FindClose(hFindFile);
end
else
begin
ChDir(sCurDir);
result:=false;
exit;
end;
//回到原来的目录下
ChDir(sCurDir);
result:=true;
end;2.拷贝目录的函数:CopyDir function CopyDir(sDirName:String;
sToDirName:string):Boolean;
begin
if Length(sDirName)< =0 then
exit;
//拷贝...
Result:=DoCopyDir(sDirName,sToDirName);
end