📄 subject_14133.htm
字号:
<p>
序号:14133 发表者:YuanShan 发表日期:2002-09-04 01:17:53
<br>主题:请问如何用VC++6.0删除某个子目录和它所含的所有文件?
<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>回复者:yxx 回复日期:2002-09-04 10:18:44
<br>内容:BOOL TDlgMain::DeleteDirectory(char *DirName)<BR>{<BR> CFileFind tempFind;<BR> char tempFileFind[200];<BR> sprintf(tempFileFind,"%s\\*.*",DirName);<BR> BOOL IsFinded=(BOOL)tempFind.FindFile(tempFileFind);<BR> while(IsFinded)<BR> {<BR> IsFinded=(BOOL)tempFind.FindNextFile();<BR> if(!tempFind.IsDots())<BR> {<BR> char foundFileName[200];<BR> strcpy(foundFileName,tempFind.GetFileName().GetBuffer(200));<BR> if(tempFind.IsDirectory())<BR> {<BR> char tempDir[200];<BR> sprintf(tempDir,"%s\\%s",DirName,foundFileName);<BR> DeleteDirectory(tempDir);<BR> }<BR> else<BR> {<BR> char tempFileName[200];<BR> sprintf(tempFileName,"%s\\%s",DirName,foundFileName);<BR> DeleteFile(tempFileName);<BR> }<BR> }<BR> }<BR> tempFind.Close();<BR> return TRUE;<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 + -