<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>https://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>https://jackxiang.com/post//</link>
<title><![CDATA[Windows下如何用C语言清空特定文件夹中的所有文件]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Unix/LinuxC技术]]></category>
<pubDate>Wed, 13 Jun 2012 04:33:59 +0000</pubDate> 
<guid>https://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	来自：http://software.intel.com/zh-cn/blogs/2011/10/12/c-13/?cid=sw:prccsdn2030<br/><textarea name="code" class="C" rows="15" cols="100">
#include &quot;iostream.h&quot;&nbsp;&nbsp;&nbsp;&nbsp;//由于该博客系统发布是不能显示正常，代码如需调试，只需将改成&quot;&quot;即可
#include &quot;string.h&quot;
#include &quot;stdlib.h&quot;
#include &quot;time.h&quot;
#include &quot;math.h&quot;
#include &quot;windows.h&quot;
#include &quot;stdio.h&quot;
#include &quot;shellapi.h&quot;
#include &quot;fstream.h&quot;
#include &quot;string&quot;
using namespace std;
void main()
&#123;
&nbsp;&nbsp;//清空特定文件夹中的所有文件
&nbsp;&nbsp;char* a=&quot;.&quot;;
&nbsp;&nbsp;char* b=&quot;&quot;;
&nbsp;&nbsp;WIN32_FIND_DATA FileData,FileData_0;
&nbsp;&nbsp;HANDLE hSearch,hSearch_0;
&nbsp;&nbsp;BOOL fFinished=FALSE;
&nbsp;&nbsp;hSearch=FindFirstFile(&quot;C:&#92;&#92;experiment&#92;&#92;results_stat&#92;&#92;*.*&quot;,&amp;FileData);&nbsp;&nbsp;&nbsp;&nbsp; //输入特定文件的绝对路径名
&nbsp;&nbsp;if(hSearch==INVALID_HANDLE_VALUE)
&nbsp;&nbsp;&#123;
&nbsp;&nbsp;&nbsp;&nbsp;printf(&quot;No&nbsp;&nbsp; files&nbsp;&nbsp; found.&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;return;
&nbsp;&nbsp;&#125;
&nbsp;&nbsp;while(!fFinished)
&nbsp;&nbsp;&#123;
&nbsp;&nbsp;&nbsp;&nbsp;if(FileData.cFileName[0]!=a[0])&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b=FileData.cFileName;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string addr=string(&quot;C:&#92;&#92;experiment&#92;&#92;results_stat&#92;&#92;&quot;)+string(b)+string(&quot;&#92;&#92;&quot;)+string(&quot;*.*&quot;);&nbsp;&nbsp;&nbsp;&nbsp;//输入特定文件的绝对路径名
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hSearch_0=FindFirstFile(addr.c_str(),&amp;FileData_0);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(FindNextFile(hSearch_0,&nbsp;&nbsp; &amp;FileData_0))&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(FileData_0.cFileName[0]!=a[0])&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string addr_0=string(&quot;C:&#92;&#92;experiment&#92;&#92;results_stat&#92;&#92;&quot;)+string(b)+string(&quot;&#92;&#92;&quot;)+FileData_0.cFileName;&nbsp;&nbsp;&nbsp;&nbsp;//输入特定文件的绝对路径名
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DeleteFile(addr_0.c_str());&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//清空特定文件夹中的子文件夹中的所有文件
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&nbsp;&nbsp;&nbsp;&nbsp;if(!FindNextFile(hSearch,&amp;FileData))
&nbsp;&nbsp;&nbsp;&nbsp;&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(GetLastError()==ERROR_NO_MORE_FILES)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fFinished=TRUE;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(&quot;Couldn&#039;t&nbsp;&nbsp; find&nbsp;&nbsp; next&nbsp;&nbsp; file.&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&nbsp;&nbsp;&#125;
&nbsp;&nbsp;FindClose(hSearch);
&nbsp;&nbsp;FindClose(hSearch_0);
&#125;

</textarea>
]]>
</description>
</item><item>
<link>https://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] Windows下如何用C语言清空特定文件夹中的所有文件]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>