博客
关于我
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/

你可能感兴趣的文章
Nginx实现动静分离
查看>>
Nginx实现反向代理负载均衡
查看>>
nginx实现负载均衡
查看>>
Nginx实现负载均衡时常用的分配服务器策略
查看>>
Nginx实现限流
查看>>
Nginx将https重定向为http进行访问的配置(附Demo)
查看>>
Nginx屏蔽电脑端访问,但不限制蜘蛛爬取
查看>>
nginx工作笔记004---配置https_ssl证书_视频服务器接口等
查看>>
nginx工作笔记005---nginx配置负载均衡_在微服务中实现网关集群_实现TCP传输层协议__http协议的负载均衡
查看>>