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
);
它也可以找目录

解决方案 »

  1.   

    int _access( const char *path, int mode );
      

  2.   

    The FindFirstFile function searches a directory for a file whose name matches the specified filename. FindFirstFile examines subdirectory names as well as filenames. HANDLE FindFirstFile(
      LPCTSTR lpFileName,  // pointer to name of file to search for
      LPWIN32_FIND_DATA lpFindFileData 
                           // pointer to returned information
    );
     
    看msdn吧
      

  3.   

    用GetFileAttributes("c:\\temp");返回值不为0xFFFFFFFF,并且有这个标志:FILE_ATTRIBUTE_DIRECTORY.
      

  4.   

    WIN32_FIND_DATA FindFileData
    HANDLE FindFirstFile(
      LPCTSTR lpFileName,               // 放你要确定的目录名
      &FindFileData                     // data buffer
    );
    if(FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
    {
    目录存在。
    }
      

  5.   

    ^_^,太容易了,使用shell的函数,好像叫filepathexist,记得使用.lib,给分