WIN32_FIND_DATA fileData;
string dir = "..\\Test\\;
string file = "..\\Test\\*.*";
string fileName;
HANDLE hFile = FindFirstFile(file.c_str(), &fileData);
fileName = fileData.cFileName;
DeleteFile((dir + fileName).c_str()); // 必须是fullname
while(FindNextFile(hFile, &fileData))
{
fileName = fileData.cFileName;
DeleteFile((dir + fileName).c_str());
}
删除一个文件夹下的所有文件
最新推荐文章于 2019-06-19 17:21:40 发布