1、头文件:shlwapi.h
2、链接库:Shlwapi.lib
#include <iostream>
#include <shlwapi.h>
using namespace std;
#pragma comment(lib,"Shlwapi.lib")
int main()
{
string str = "E:\\Visual Studio 2013\\Projects\\test\\abc";
if (PathFileExists(str.c_str()))
{
MessageBox(NULL, "存在", "", MB_OK);
}
else
{
MessageBox(NULL, "不存在,那就创建一个", "", MB_OK);
CreateDirectory("E:\\Visual Studio 2013\\Projects\\test\\abc", NULL);
}
cin.get();
return 0;
}