分类: C/C++
2007-05-16 15:26:20
#include
#include
#include
using namespace std;
void filesearch(string path,int layer)
{
struct _finddata_t filefind;
string curr=path+"\\*.*";
int done=0,i,handle;
if((handle=_findfirst(curr.c_str(),&filefind))==-1)return;
while(!(done=_findnext(handle,&filefind)))
{
if(!strcmp(filefind.name,".."))continue;
for(i=0;i
{
cout<
filesearch(curr,layer+1);
}
else
{
cout<
}
_findclose(handle);
}
int main()
{
string path;
cout<<"请输入目录"<
filesearch(path,0);
system("PAUSE");
return 0;
}