System.IO.Directory namespace 里的GetFiles(string),可以用"*.mp3"通配符。还有些重载的函数,查查MSDN吧。Gets the files in the specified directory.
public static string[] GetFiles(string);Gets an array of file names matching the specified search criteria from the specified directory.
public static string[] GetFiles(string, string);GetCurrentDirectory ----- Gets the current directory. 
GetDirectories ----- Overloaded. Gets an array of directories in the current directory. 
GetDirectoryRoot ----- Returns the root portion of the specified path. 

解决方案 »

  1.   

    慢就是你算法的问题了,完全可以不用递归。以前学过两层while循环代替递归调用的方法,你可以试试。搜索硬盘上的所有文件本来就是很慢的工作。不过用递归浪费资源也太不值得了。
      

  2.   

    呵呵,“我用System.IO.Directory的方法+递归”
    已经说明了我会用System.IO.Directory的方法,这点您不用再说了。我也知道用递归是慢的主要原因,不然我就不用在问题里特意告诉你了。
    “两层while循环代替递归调用”的方法我不会,你写写代码来让我学学?