PathFileExists 函数可以用来查看一个文件或文件夹是否存在。

用法:

在头文件中

#include <shlwapi.h>

#pragma comment(lib,"Shlwapi.lib") //如果没有这行,会出现link错误

    if (PathFileExists(strDBPath))
    {
           //存在

    }

    else  CreateDirectory(html_path_out1, NULL);  //文件夹不存在

 

顺便记录下今天百度到底几条指令:

1. Cstring.Replace('/','\\');    //将地址中的'/'替换为'\\'

2. CString html_path_in = html_Name_in1.Left(html_Name_in1.ReverseFind('\\')+1);   //取html_Name_in1在'\\'之前的字符串
Logo

Agent 垂直技术社区,欢迎活跃、内容共建,欢迎商务合作。wx: diudiu5555

更多推荐