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);


}

原文地址:https://www.cnblogs.com/huaen/p/3501317.html