BOOL TPubTools::FolderExist(const CString &strPath)
{
WIN32_FIND_DATA wfd;
HANDLE hFind;
BOOL bRet = FALSE;
hFind = FindFirstFile(strPath, &wfd);
if (hFind != INVALID_HANDLE_VALUE)
{
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
bRet = TRUE;
}
FindClose(hFind);
}
return bRet;
}
BOOL TPubTools::FileExist(const CString &strPath)
{
WIN32_FIND_DATA wfd;
HANDLE hFind;
BOOL bRet = FALSE;
hFind = FindFirstFile(strPath, &wfd);
if (hFind != INVALID_HANDLE_VALUE)
{
if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
bRet = TRUE;
}
FindClose(hFind);
}
return bRet;
}
时间: 2024-11-08 22:51:25