解决方案 »

  1.   

    判断文件存不存在可以使用::FindFirstFileTCHAR szFilePath[MAX_PATH] = {0};
    wsprintf(szFilePath,_T("%s"),_T("D:\\Media\\TokoHot\\xxx.txt"));
    WIN32_FIND_DATA fd = {0};
    HANDLE hFind = FindFirstFile(g_cszConfigPath, &fd);
    if(hFind && hFind == INVALID_HANDLE_VALUE)
    {
           //文件存在
    }
      

  2.   


    TCHAR szFilePath[MAX_PATH] = {0};
    wsprintf(szFilePath,_T("%s"),_T("D:\\Media\\TokoHot\\xxx.txt"));
    WIN32_FIND_DATA fd = {0};
    HANDLE hFind = FindFirstFile(szFilePath, &fd);
    if(hFind && hFind == INVALID_HANDLE_VALUE)
    {
           //文件存在
    }
      

  3.   

    shit!
    if(hFind && hFind != INVALID_HANDLE_VALUE)
    {
           //文件存在
    }
      

  4.   

    MFC有现成的文件操作类 CFileFinder   。很简单
      

  5.   

    在fopen后,判断文件指针是否为空就可以判断文件是否存在了