压缩文件拷贝的问题!

xin_zzq1 2009-07-14 02:47:10
怎么样用程序去实现某个文件夹下的一个压缩文件(.rar或者其他的压缩格式)拷贝到其他文件夹下面!
...全文
147 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
luckyboy101 2009-07-14
  • 打赏
  • 举报
回复
CopyFile
The CopyFile function copies an existing file to a new file.

BOOL CopyFile(
LPCTSTR lpExistingFileName,
// pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);

Parameters
lpExistingFileName
Pointer to a null-terminated string that specifies the name of an existing file.
lpNewFileName
Pointer to a null-terminated string that specifies the name of the new file.
bFailIfExists
Specifies how this operation is to proceed if a file of the same name as that specified by lpNewFileName already exists. If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks
Security attributes for the existing file are not copied to the new file.

File attributes for the existing file are copied to the new file. For example, if an existing file has the FILE_ATTRIBUTE_READONLY file attribute, a copy created through a call to CopyFile will also have the FILE_ATTRIBUTE_READONLY file attribute.

Windows CE: If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError.

xin_zzq1 2009-07-14
  • 打赏
  • 举报
回复
那我去试试··谢谢啊!
xin_zzq1 2009-07-14
  • 打赏
  • 举报
回复
也就是说··从A.CAB要从个文件夹下拷贝到其他的地方··文件名还是A.CAB
快乐鹦鹉 2009-07-14
  • 打赏
  • 举报
回复
CopyFile没有说哪种文件不能拷贝啊。
偶以为因该都是可以的。
xin_zzq1 2009-07-14
  • 打赏
  • 举报
回复
是的啊!我也看了Copyfile!但是我要拷贝的是一个A.CAB文件!不知道能不能拷贝
supconsupcon 2009-07-14
  • 打赏
  • 举报
回复
用BOOL CopyFile(LPCTSTR lpExistingFileName,LPCTSTR lpNewFileName,BOOL bFailIfExists );
快乐鹦鹉 2009-07-14
  • 打赏
  • 举报
回复
没有要求做压缩吧?
快乐鹦鹉 2009-07-14
  • 打赏
  • 举报
回复
BOOL CopyFile(LPCTSTR lpExistingFileName,LPCTSTR lpNewFileName,BOOL bFailIfExists );
 参数 类型及说明
  lpExistingFileName String,源文件名
  lpNewFileName String,目标文件名
  bFailIfExists Long,如果设为TRUE(非零),那么一旦目标文件已经存在,则函数调用会失败。否则目标文件被改写
healer_kx 2009-07-14
  • 打赏
  • 举报
回复
CopyFile很好说了,但是压缩要用到zlib等库,rar的算法并不公开吧?

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧