DirectoryExists

 

判断文件夹是否存在

 

关键点

GetFileAttributes

The GetFileAttributes function retrieves attributes for a specified file or directory.

This function retrieves a set of FAT-style attribute information. The GetFileAttributesEx function can obtain other sets of file or directory attribute information.

DWORD GetFileAttributes(

  LPCTSTR lpFileName   // name of file or directory

);

 

实现过程

 

BOOL DirectoryExists(CString DirectoryPath)
{
    if (GetFileAttributes(DirectoryPath) == FILE_ATTRIBUTE_DIRECTORY)
        return TRUE;
    else
        return FALSE;
}

 

 

   


 

备注

 

 

相关链接

                           

 

 




posted @ 2014-05-17 21:08  XE2011  阅读(494)  评论(0编辑  收藏  举报