FindFirstFile
The FindFirstFile function searches a directory for a file whose name matches the specified file name. FindFirstFile examines subdirectory names as well as file names. To specify additional attributes to be used in the search, use the FindFirstFileEx function. HANDLE FindFirstFile(
LPCTSTR lpFileName, // file name
LPWIN32_FIND_DATA lpFindFileData // data buffer
);
它也可以找目录
The FindFirstFile function searches a directory for a file whose name matches the specified file name. FindFirstFile examines subdirectory names as well as file names. To specify additional attributes to be used in the search, use the FindFirstFileEx function. HANDLE FindFirstFile(
LPCTSTR lpFileName, // file name
LPWIN32_FIND_DATA lpFindFileData // data buffer
);
它也可以找目录
LPCTSTR lpFileName, // pointer to name of file to search for
LPWIN32_FIND_DATA lpFindFileData
// pointer to returned information
);
看msdn吧
HANDLE FindFirstFile(
LPCTSTR lpFileName, // 放你要确定的目录名
&FindFileData // data buffer
);
if(FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
{
目录存在。
}