请教一下大家:用什么方法可以判断一个在字符串里的路径是否可用?

解决方案 »

  1.   

    if(!file.Open(strFilePath, CFile::modeRead))
       return;
      

  2.   

    #include "io.h"
    _access(...)
      

  3.   

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/shlwapi/path/pathfileexists.asp注意包含相应头文件和库
      

  4.   

    if(GetFileAttributes(filename)==0xFFFFFFFF)
    {
    //文件或路径名无效
    }