CString strFolderPath="c:\\test"
// 判断路径是否存在
if (!PathIsDirectory(m_strFolderPath) )
{
CString strMsg;
strMsg.Format ("指定路径\"%s\"不存在,是否创建?", m_strFolderPath);
if (AfxMessageBox(strMsg, MB_YESNO) == IDYES)
{
if (!CreateDirectory(m_strFolderPath, NULL ) )
{
strMsg.Format ("创建路径\"%s\"失败!是否继续?", m_strFolderPath);
if (AfxMessageBox(strMsg, MB_YESNO) == IDYES)
return;
}
}
}
-------------------------------------------------------
CreateDirectory(LPCTSTR lpPathName, //irectory name
LPSECURITY_ATTRIBUTES lpSecurityAttributes // SD
)
CString
strFolderPath="c:\\test"
//
判断路径是否存在
if
(!PathIsDirectory(m_strFolderPath)
)
{
CString
strMsg;
strMsg.Format
("指定路径\"%s\"不存在,是否创建?",
m_strFolderPath);
if
(AfxMessageBox(strMsg,
MB_YESNO)
==
IDYES)
{
if
(!CreateDirectory(m_strFolderPath,
NULL
)
)
{
strMsg.Format
("创建路径\"%s\"失败!是否继续?",
m_strFolderPath);
if
(AfxMessageBox(strMsg,
MB_YESNO)
==
IDYES)
return;
}
}
}
-------------------------------------------------------
CreateDirectory(LPCTSTR
lpPathName,
//irectory
name
LPSECURITY_ATTRIBUTES
lpSecurityAttributes
//
SD
)