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

你可能感兴趣的文章
MySQL InnoDB引擎的锁机制详解
查看>>
Mysql INNODB引擎行锁的3种算法 Record Lock Next-Key Lock Grap Lock
查看>>
mysql InnoDB数据存储引擎 的B+树索引原理
查看>>
mysql innodb通过使用mvcc来实现可重复读
查看>>
mysql insert update 同时执行_MySQL进阶三板斧(三)看清“触发器 (Trigger)”的真实面目...
查看>>
mysql interval显示条件值_MySQL INTERVAL关键字可以使用哪些不同的单位值?
查看>>
Mysql join原理
查看>>
MySQL Join算法与调优白皮书(二)
查看>>
Mysql order by与limit混用陷阱
查看>>
Mysql order by与limit混用陷阱
查看>>
mysql order by多个字段排序
查看>>
MySQL Order By实现原理分析和Filesort优化
查看>>
mysql problems
查看>>
mysql replace first,MySQL中处理各种重复的一些方法
查看>>
MySQL replace函数替换字符串语句的用法(mysql字符串替换)
查看>>
mysql replace用法
查看>>
Mysql Row_Format 参数讲解
查看>>
mysql select, from ,join ,on ,where groupby,having ,order by limit的执行顺序和书写顺序
查看>>
MySQL Server 5.5安装记录
查看>>
mysql server has gone away
查看>>