MFC下判断文件夹是否存在,如不存在则创建文件夹

void CWireLessDlg::CreatePakcetFile()
{
 CString   strFolderPath;
 strFolderPath = _T("D:\\无线通信板报文存储文件夹");
 if(!PathIsDirectory(strFolderPath))//判断路径是否存在     
    CreateDirectory(strFolderPath,NULL);//新建文件夹
 strFolderPath = _T("D:\\无线通信板报文存储文件夹\\UDP");
 if(!PathIsDirectory(strFolderPath))//判断路径是否存在     
    CreateDirectory(strFolderPath,NULL);//新建文件夹
}

 

转载   https://www.cnblogs.com/judes/p/6541944.html

posted @ 2019-01-16 09:51  西呱  阅读(5595)  评论(0编辑  收藏  举报