zoukankan      html  css  js  c++  java
  • CheckDirectory

     BOOL CCorrectDataOper::CheckDirectory(CString szPath)

    {

             //查找目录是否存在,不存在则建立目录

             CFileFind ff;

             CString szDir = szPath;

             if(szDir.Right(1) != "\\")

                       szDir += "\\";

             CString sztmp = szDir;

             if (sztmp.Right(1)=="\\") sztmp.TrimRight('\\');

             BOOL bExist = ff.FindFile(sztmp);

             if (bExist == FALSE)//目录不存在创建目录

             {

                       if (!CreateDirectory(sztmp, NULL))

                       {

                                AfxMessageBox(sztmp+_T("目录创建失败!"));

                                return FALSE;

                       }

             }

             return TRUE;

    }

  • 相关阅读:
    Disharmony Trees HDU
    Xenia and Bit Operations CodeForces
    Gym
    背包入门
    搜索入门
    Farm Tour POJ
    Flow Problem HDU
    Hie with the Pie POJ
    Building a Space Station POJ
    kuangbin 最短路集合
  • 原文地址:https://www.cnblogs.com/carl2380/p/2083840.html
Copyright © 2011-2022 走看看