博客
关于我
c++ 复制文件到指定目录
阅读量:541 次
发布时间:2019-03-09

本文共 791 字,大约阅读时间需要 2 分钟。

代码如下:

#if 1 //仅供测试用	wstring  strsavepath = lpOutPutDir;	strsavepath += L"classified";	string imgsavepath = StringConvert::ws2s(strsavepath);	const char* dir = imgsavepath.c_str();	if (_access(dir, 0) == -1)	{		_mkdir(dir);	}	for (int i = 0; i < m_ImgPath.size(); i++)	{		string saveimgfilepath = imgsavepath +"\\"+ to_string(m_vecImgFlagOut[i]);		const char* dir = saveimgfilepath.c_str();		if (_access(dir, 0) == -1)		{			_mkdir(dir);		}		//执行复制操作		wstring srcimgfilepath = m_ImgPath[i];		string::size_type iPos = srcimgfilepath.find_last_of('\\') + 1;		wstring filename = srcimgfilepath.substr(iPos, srcimgfilepath.length() - iPos);		wstring dstimgfilepath = StringConvert::s2ws(saveimgfilepath)+L"\\" + filename;		CopyFileW(srcimgfilepath.c_str(), dstimgfilepath.c_str(), FALSE);	}	#endif

 

转载地址:http://jtqiz.baihongyu.com/

你可能感兴趣的文章
Node-RED中建立静态网页和动态网页内容
查看>>
Vue3+Element-ul学生管理系统(第二十二课)
查看>>
Node-RED中怎样让网站返回JSON数据
查看>>
Node-RED中根据HTML文件建立Web网站
查看>>
Node-RED中解析高德地图天气api的json数据显示天气仪表盘
查看>>
Node-RED中连接Mysql数据库并实现增删改查的操作
查看>>
Node-RED中通过node-red-ui-webcam节点实现访问摄像头并截取照片预览
查看>>
Node-RED中配置周期性执行、指定时间阶段执行、指定时间执行事件
查看>>
Node-RED安装图形化节点dashboard实现订阅mqtt主题并在仪表盘中显示温度
查看>>
Node-RED怎样导出导入流程为json文件
查看>>
Node-RED简介与Windows上安装、启动和运行示例
查看>>
Node-RED订阅MQTT主题并调试数据
查看>>
Node-RED通过npm安装的方式对应卸载
查看>>