W
wp231957
Unregistered / Unconfirmed
GUEST, unregistred user!
//查找文件<br>//RETD 返回查找目录名<br>//RETF 返回查找文件名<br>procedure find_file(rootpath:string;var retd:tstringlist;var retf:tstringlist);<br>var<br> wfd:WIN32_FIND_DATA;<br> hfile:dword;<br>begin<br> hfile:=findfirstfile(pchar(rootpath),wfd);<br> if hfile<>INVALID_HANDLE_VALUE then begin<br> repeat<br> if wfd.dwFileAttributes =FILE_ATTRIBUTE_DIRECTORY then<br> retd.Add(wfd.cFileName)<br> else retf.Add(wfd.cFileName);<br> until findnextfile(hfile,wfd)=false;<br> end;<br>end;