DevideStr(CString strInput, CString div, CStringArrayamp; array)

 百家乐-操作     |      2020-01-25 03:55

//分解一个串
void CParseWarning::DevideStr(CString strInput, CString div, CStringArray& array)
{
 int nPos = 0;
 int len = div.GetLength();
 CString tempString = _T("");
 nPos = strInput.Find(div);
 while(nPos >= 0)
 {
  tempString = strInput.Left(nPos);
  array.Add(tempString);
  strInput = strInput.Mid(nPos+len);
  nPos = strInput.Find(div);
 }
 array.Add(strInput);
}

BOOL CExportDlg::MyCreateDirectory(CString strDirectory)
{
 int nPos;
 int nTempPos;
 CString strTemp;
 CFileFind ff;
 BOOL bFind = ff.FindFile(strDirectory);
 if(bFind)//有此目录
  return TRUE;
 nPos = strDirectory.Find("\",3);
 if(nPos < 0)
  nPos = strDirectory.Find("/",3);
 if(nPos < 0)
  return FALSE;
 while(nPos>=0)
 {
  strTemp = strDirectory.Left(nPos);
  if(!ff.FindFile(strTemp))
  {
   if(!CreateDirectory(strTemp,NULL))
   {
    return FALSE;
   }
  }
  nTempPos = nPos;
  nPos = strDirectory.Find("\",nTempPos+1);
  if(nPos < 0)
   nPos = strDirectory.Find("/",nTempPos+1);
 }
 if(!CreateDirectory(strDirectory,NULL))
 {
  return FALSE;
 }
 return TRUE;
}