首页 > 其他 > 详细

MFC如何创建目录

时间:2014-09-22 23:04:04      阅读:372      评论:0      收藏:0      [点我收藏+]
  1. 1.    MFC只能使用CString类,它的格式化

      CString m_strFolderPath;

      m_strFolderPath.Format(_T("F:\\%s"),load.m_name);

  1. 如何创建目录

CString m_strFolderPath;

        m_strFolderPath.Format(_T("F:\\%s"),load.m_name);   

 

        if(!PathIsDirectory(m_strFolderPath))

        {

            CString strMsg;

            strMsg.Format (_T("指定路径\"%s\"不存在,是否创建?"), m_strFolderPath);

            if (AfxMessageBox(strMsg, MB_YESNO) == IDYES)

            {

            if (!CreateDirectory(m_strFolderPath, NULL ) )

            {

            strMsg.Format(_T("创建路径\"%s\"失败!是否继续?"), m_strFolderPath);

            if (AfxMessageBox(strMsg, MB_YESNO) == IDYES)

            return;

        }

        }

        }

MFC如何创建目录

原文:http://www.cnblogs.com/hualimengyu/p/3986853.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!