VS 创建、删除文件夹

	// 1、创建文件夹
	string command;
	string defaultPath;
	for (int i = 1; i < 100; i++)
	{
		sprintf(saveName, "\\result%d", i); // 命名result1...result10文件夹
		defaultPath = saveName;// 
		command = "mkdir result" + defaultPath; // result文件夹下创建defaultPath文件夹
		system(command.c_str());
	}
	// 2、删除文件夹
	string Path;
	for (int i = 1; i < 100; i++)
	{
		sprintf(saveName, "\\result%d", i); // 命名result1...result10文件夹
		Path = saveName;//
		command = "rd result" + Path;
		system(command.c_str());
	}

猜你喜欢

转载自blog.csdn.net/qq_38676868/article/details/90174081