用MFC如何创建文件夹?
展开全部
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
)
// 判断路径是否存在
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
)
参考资料: http://topic.csdn.net/t/20010925/22/302818.html
展开全部
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
)
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
)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询