CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

VC中用什么方法完成文件的复制?

楼主gular(胡不归)2002-05-11 10:19:41 在 VC/MFC / 基础类 提问

VC中用什么方法完成文件的复制?谢谢 问题点数:50、回复次数:3Top

1 楼yu_hl(卖柴火的小男孩)回复于 2002-05-11 10:21:38 得分 40

CopyFile   or   SHFileOperationTop

2 楼papaya_stone(^_^)shentong(^_^)回复于 2002-05-11 10:22:40 得分 10

MSDN:  
   
  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.  
   
  QuickInfo  
      Windows   NT:   Requires   version   3.1   or   later.  
      Windows:   Requires   Windows   95   or   later.  
      Windows   CE:   Requires   version   1.0   or   later.  
      Header:   Declared   in   winbase.h.  
      Import   Library:   Use   kernel32.lib.  
      Unicode:   Implemented   as   Unicode   and   ANSI   versions   on   Windows   NT.  
   
  See   Also  
  File   I/O   Overview,   File   Functions,   CreateFile,   MoveFile    
   
     
  Top

3 楼gular(胡不归)回复于 2002-05-11 10:24:46 得分 0

Thank   you!  
  以后请多多帮助!  
  给分!Top

相关问题

  • vb中复制文件的方法
  • 复制文件哪种方法最好???
  • 文件复制
  • 文件复制
  • VB里有哪些方法可以复制文件?
  • 有没有不用FSO的复制文件夹得方法?
  • 不想复制隐藏的文件用什么方法????????????????????
  • 求 文件夹重命名,文件复制,剪切 方法 高手帮忙
  • VC中使用ini文件的方法
  • 请教vc能人!求多个文件复制方案!!!

关键词

  • 文件
  • vc
  • null
  • lpnewfilename
  • existing
  • bfailifexists
  • copyfile
  • succeeds
  • already
  • pointer

得分解答快速导航

  • 帖主:gular
  • yu_hl
  • papaya_stone

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo