#include "iostream.h"
//代码如需调试,只需将改成""即可
#include "string.h"
#include "stdlib.h"
#include "time.h"
#include "math.h"
#include "windows.h"
#include "stdio.h"
#include "shellapi.h"
#include "fstream.h"
#include "string"
using namespace std;
void main()
{
//清空特定文件夹中的所有文件
char* a=".";
char* b="";
WIN32_FIND_DATA FileData,FileData_0;
HANDLE hSearch,hSearch_0;
BOOL fFinished=FALSE;
hSearch=FindFirstFile("C:\\experiment\\results_stat\\*.*",&FileData);
//输入特定文件的绝对路径名
if(hSearch==INVALID_HANDLE_VALUE)
{
printf("No files found.");
return;
}
while(!fFinished)
{
if(FileData.cFileName[0]!=a[0]){
b=FileData.cFileName;
string addr=string("C:\\experiment\\results_stat\\")+string(b)+string("\\")+string("*.*");
//输入特定文件的绝对路径名
hSearch_0=FindFirstFile(addr.c_str(),&FileData_0);
while(FindNextFile(hSearch_0, &FileData_0)){
if(FileData_0.cFileName[0]!=a[0]){
string addr_0=string("C:\\experiment\\results_stat\\")+string(b)+string("\\")+FileData_0.cFileName;
//输入特定文件的绝对路径名
DeleteFile(addr_0.c_str());
//清空特定文件夹中的子文件夹中的所有文件
}
}
}
if(!FindNextFile(hSearch,&FileData))
{
if(GetLastError()==ERROR_NO_MORE_FILES)
{
fFinished=TRUE;
}
else
{
printf("Couldn't find next file.");
return;
}
}
}
FindClose(hSearch);
FindClose(hSearch_0);
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有