MFC确认文件夹是否存在,以及创建文件夹

xiaoxiao2021-02-28  27

来源 :http://blog.csdn.net/chidy/article/details/8623511

bool PathIsDirectory(CString cstrPath)  检测路径是否存在.cstrPath是文件夹的路径,如"D:\\hello"或者"D:\\hello\\",有没有最后的"\\"对结果无影响。

CreateDirectioy(CString cstrPath, 0) 创建文件夹,cstrPath是文件夹的路径,如"D:\\hello"或者"D:\\hello\\",有没有最后的"\\"对结果无影响。

两个函数需要使用shlwapi.h头文件以及添加shlwapi.lib或shlwapi.dll 库函数

转载请注明原文地址: https://www.6miu.com/read-2628574.html

最新回复(0)