📄 subject_21466.htm
字号:
<p>
序号:21466 发表者:金枪鱼 发表日期:2002-11-17 21:14:30
<br>主题:怎样用VC++代码复制文件?
<br>内容:实在是菜!!!<BR>请指点以下如果实现文件的复制。
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:凯凯 回复日期:2002-11-17 21:32:05
<br>内容:CopyFile<BR>The CopyFile function copies an existing file to a new file. <BR><BR>BOOL CopyFile(<BR> LPCTSTR lpExistingFileName,<BR> // pointer to name of an existing file<BR> LPCTSTR lpNewFileName, // pointer to filename to copy to<BR> BOOL bFailIfExists // flag for operation if file exists<BR>);<BR> <BR>Parameters<BR>lpExistingFileName <BR>Pointer to a null-terminated string that specifies the name of an existing file. <BR>lpNewFileName <BR>Pointer to a null-terminated string that specifies the name of the new file. <BR>bFailIfExists <BR>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. <BR>Return Values<BR>If the function succeeds, the return value is nonzero.<BR><BR>If the function fails, the return value is zero. To get extended error information, call GetLastError. <BR><BR>Remarks<BR>Security attributes for the existing file are not copied to the new file. <BR><BR>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. <BR><BR>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.<BR><BR>QuickInfo<BR> Windows NT: Requires version 3.1 or later.<BR> Windows: Requires Windows 95 or later.<BR> Windows CE: Requires version 1.0 or later.<BR> Header: Declared in winbase.h.<BR> Import Library: Use kernel32.lib.<BR> Unicode: Implemented as Unicode and ANSI versions on Windows NT.<BR><BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:金鱼王 回复日期:2002-11-17 22:40:50
<br>内容:果然是菜鸟专用的。哈哈!!!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -