目的: copy指定文件名的文件
问题:加上
if (Specifyfile == str_fileName) //当前文件名是否等于指定文件名,copyfile不成功(逻辑是ok的)
去掉限制条件,copyfile是ok(复制目录下所有文件)
Specifyfile :传入要copy的指定文件名
以下是主要代码部分
CString str_fileName;
str_fileName = finder.GetFileName();
//if (str_fileName.Right(3) == _T("h2w")) //如果后缀是txt文件才处理,限制条件ok
if (Specifyfile == str_fileName) //当前文件名是否等于指定文件名,
{
CopyFile(finder.GetFilePath(),strDestPath+"/"+finder.GetFileName(),FALSE);
CString str,str1;
str.Format(_T("%s"),finder.GetFileName());
str1.Format(_T("%s"),finder.GetFilePath());
}
下图就是运行时的参数赋值:
那位大神帮我看看是什么位置出现问题?或者有没有什么更好代码分享一下,谢谢