MFC判断某路径下的目标文件是否存在
PathFileExists 函数可以用来查看一个文件或文件夹是否存在。用法:在头文件中#include#pragma comment(lib,"Shlwapi.lib") //如果没有这行,会出现link错误 if (PathFileExists(strDBPath)) { //存在 } else CreateD
·
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在'\\'之前的字符串更多推荐
所有评论(0)