Добрый день, тема уже была, но всёже... Вот мой код:
| Код | CString str, str1, execute; str.Format("Z:\\*.*"); _finddata_t data; intptr_t path = _findfirst (str,&data); if (path != -1) { CString tt = strstr(data.name,_T(".")); if (tt != _T(".")) MessageBox(data.name); while (_findnext(path,&data)== 0) { tt = strstr(data.name,".."); if (tt != "..") { str1.Format("Z:\\%s\\TEMP\\*.*",data.name); _finddata_t nextf; intptr_t put = _findfirst (str1,&nextf); if (put != -1) { while (_findnext(put,&nextf)== 0) { tt = ""; tt = strstr(nextf.name,".."); if (tt != "..") { if (nextf.attrib == 16) { CString temper; temper.Format("%s",nextf.name); if (temper.Mid(0,4) == "2007") { execute.Format("Z:\\%s\\TEMP\\%s\0",data.name,nextf.name); SHFILEOPSTRUCT fa; fa.fFlags = FOF_NOERRORUI | FOF_NOCONFIRMATION; fa.hNameMappings = NULL; fa.hwnd = m_hWnd; fa.pFrom = (LPCSTR)execute; fa.pTo = NULL; fa.wFunc = FO_DELETE; int nRes = ::SHFileOperation(&fa); } } } } } _findclose(put); } } MessageBox("Готово!"); }
|
Подскажите почему не работает? Заранее благодарен!!! |