windows编程之文件夹遍历

利用windows的API,FindFirstFile和FileNextFile,采用递归遍历指定文件夹中的所有文件及文件夹,第一次windows编程,代码写的很臃肿难看,请大家多多包涵!

#include
#include
#include
#include

#define MAXN 100005

using namespace std;

void surf(WIN32_FIND_DATA myData)
{
	cout<





我的当前目录下的test文件夹有“haha”文件夹以及test.1 , test , 2 , test , 3三个文件,"haha"文件夹里又含有“ai”文件夹以及haha.1 , haha.2 , haha.3三个文件,“ai”文件夹里又含有“wo”文件夹以及ai.1 , ai.2 , ai.3三个文件,"wo"文件夹里有wo.1 , wo.2 , wo.3三个文件。。。


程序输出结果:

=========haha==========
1556376338
2156419021
2156419021
2014年5月31日10时16分18秒
2014年5月31日10时24分27秒
2014年5月31日10时24分27秒


=========ai==========
2147248496
772195107
772195107
2014年5月31日10时24分27秒
2014年5月31日11时26分34秒
2014年5月31日11时26分34秒


=========ai.1==========
2197291359
2197291359
2197291359
2014年5月31日10时24分32秒
2014年5月31日10时24分32秒
2014年5月31日10时24分32秒


=========ai.2==========
2197291359
2328198846
2328198846
2014年5月31日10时24分32秒
2014年5月31日10时24分45秒
2014年5月31日10时24分45秒


=========ai.3==========
2197291359
2387262224
2387262224
2014年5月31日10时24分32秒
2014年5月31日10时24分51秒
2014年5月31日10时24分51秒


=========wo==========
752914004
2835575798
2835575798
2014年5月31日11时26分33秒
2014年5月31日15时40分33秒
2014年5月31日15时40分33秒


=========wo.1==========
806557072
806557072
806557072
2014年5月31日11时26分38秒
2014年5月31日11时26分38秒
2014年5月31日11时26分38秒


=========wo.2==========
870010701
870010701
870010701
2014年5月31日11时26分44秒
2014年5月31日11时26分44秒
2014年5月31日11时26分44秒


=========wo.3==========
870010701
923383754
923383754
2014年5月31日11时26分44秒
2014年5月31日11时26分50秒
2014年5月31日11时26分50秒


=========haha.1==========
1601118898
1601118898
1601118898
2014年5月31日10时16分22秒
2014年5月31日10时16分22秒
2014年5月31日10时16分22秒


=========haha.2==========
1601118898
1678113301
1678113301
2014年5月31日10时16分22秒
2014年5月31日10时16分30秒
2014年5月31日10时16分30秒


=========haha.3==========
1601118898
1742136963
1742136963
2014年5月31日10时16分22秒
2014年5月31日10时16分36秒
2014年5月31日10时16分36秒


=========test.1==========
1835930690
1835930690
1601118898
2014年5月31日10时23分55秒
2014年5月31日10时23分55秒
2014年5月31日10时16分22秒


=========test.2==========
1924505756
1924505756
1678113301
2014年5月31日10时24分4秒
2014年5月31日10时24分4秒
2014年5月31日10时16分30秒


=========test.3==========
1924535758
1924535758
1742136963
2014年5月31日10时24分4秒
2014年5月31日10时24分4秒
2014年5月31日10时16分36秒



你可能感兴趣的:(Frontend,Development,Algorithm,Programming,Language)