删除指定目录下的文件有哪些办法???? 同意楼上...之所以比CFile::remove快捷是因为它不用任何类,直接用就可以 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 C++中int remove(const char *filename); boost中在C++库boost里有独立于OS平台的filesystem class 对于删除整个文件夹或者删除单个文件,举例: ////////////////////////////// // // boost::filesystem // filesystem remove remove_all // ////////////////////////////// #include <boost/filesystem/operations.hpp> int main(int argc, char** argv) { if ( argc != 2 ) return EXIT_FAILURE; boost::filesystem::path path_( argv[1] ); // define path of file or directory; int removed = boost::filesystem::remove_all( path_ ); // remove entire directory; //boost::filesystem::remove( path_ ); // remove single file; return EXIT_SUCCESS; } [110分]DirectShow 拖影问题 请教有关窗口重绘大量数据保存问题 MDI程序主窗口最小化后再最大化,无模式对话框窗口是否被删除? 提问关于ButtonST按钮图标的问题 运算符重载碰到的疑惑 怎样修改文件属性中的文件修改时间 MFC对话框程序中,如何判断鼠标的位置是否在图片框上!? ADO对大二进制文件的操作 windows7 下编程,往C盘拷文件不成功,如何提升程序执行权限??? MFC socket编程,文件传输:当服务器端接收到客户端连接请求时,会显示连接成功对话框 C#中如何引用C++中的结构体? 执行ShellExecute()的问题
int remove(const char *filename);
boost中
在C++库boost里有独立于OS平台的filesystem class
对于删除整个文件夹或者删除单个文件,举例:
//////////////////////////////
//
// boost::filesystem
// filesystem remove remove_all
//
//////////////////////////////
#include <boost/filesystem/operations.hpp>
int main(int argc, char** argv)
{
if ( argc != 2 ) return EXIT_FAILURE;
boost::filesystem::path path_( argv[1] ); // define path of file or directory;
int removed = boost::filesystem::remove_all( path_ ); // remove entire directory;
//boost::filesystem::remove( path_ ); // remove single file;
return EXIT_SUCCESS;
}