fileprocess.c

来自「GPS 定位授时源码」· C语言 代码 · 共 50 行

C
50
字号
#include "stdafx.h"
#include "windows.h"
#include "Lambda.h"
#include "fstream.h"
#include "iomanip.h"
#include "math.h"


int FileFind(char * lpPath)
{	
	
    char szFile[80];
	
    WIN32_FIND_DATA FindFileData;
	
    strcpy(szFile,lpPath);
    strcat(szFile,"\\*.*");
	
    HANDLE hFind=::FindFirstFile(szFile,&FindFileData);
    if(INVALID_HANDLE_VALUE == hFind)  return 0;
    //
    while(TRUE)
    {
        if(FindFileData.dwFileAttributes& FILE_ATTRIBUTE_DIRECTORY )
        {
            if(FindFileData.cFileName[0]!='.')
            {	
				
                strcpy(szFile,lpPath);
                strcat(szFile,"\\");
                strcat(szFile,FindFileData.cFileName);
				cout<<"The following are the files in the dorctory "<<szFile<<endl;
                FileFind(szFile);
				
            }
        }
        else
        {
            cout <<"Process the current file :  "<<FindFileData.cFileName<<endl;
			// The user add your code here
        }
        if(!FindNextFile(hFind,&FindFileData))   
			break;
    }
    FindClose(hFind);
	return 1;
}


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?