在多字节字符集模式下,非unicode字符集下。
// LinesAnd.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <Windows.h>
#include<iostream>
#include<vector>
#include <string>
using namespace std;
//遍历文件夹查找指定文件名的文件(cFileType=NULL即所有文件)
BOOL FindFiles(char* lpPath,char *cFileType,std::vector<const std::string> &fileList)
{
char szFind[MAX_PATH] ={0};
WIN32_FIND_DATA FindFileData;
strcpy_s(szFind,lpPath);
strcat_s(szFind,"\\*.*");
HANDLE hFind=::FindFirstFile(szFind,&FindFileData);
if(INVALID_HANDLE_VALUE == hFind)
{
FindClose(hFind);
return FALSE;
}
while(true)
{
if(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if(FindFileData.cFileName[0]!='.')
{
char szFile[MAX_PATH] = {0};
strcpy_s(szFil