AX查找文件和遍历文件夹

static void findFiles(Args _args)
{
void findFile(str path,str filesExt,boolean subFolder=false)
{
int hdl;
Filename filename;
;
[hdl, filename] = WinAPI::findFirstFile(path+filesExt);
while (filename)
{
info(path+filename);
filename = WinAPI::findNextFile(hdl);
}

if(subFolder)//如果不需要遍历文件夹,这段可以忽略
{
[hdl, filename] = WinAPI::findFirstFile(path+"*");
while (filename)
{
if(filename != "." &&filename != ".."&&WinAPI::folderExists(path+filename))
findFile(path+filename+"\\",filesExt,subFolder);
filename = WinAPI::findNextFile(hdl);
}

}//遍历文件夹-- end
WinAPI::findClose(hdl);
}
;
findFile("D:\\","*.zip",true);


}

posted @ 2014-01-02 09:29  Huaen  阅读(239)  评论(0编辑  收藏  举报