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.
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.
解决方案 »
- 保存图片路径到数据库,发现路径没有完整保存
- 关于网页自动点击问题
- 问一个很简单的问题
- 使用Visual C#.NET编写的软件如何打包? (让没有安装.net或是FRAMWORK)的都能运行!)
- 我是这样动态取数据的,请问怎么样才能在DELETE 按钮上写代码删除DATAGRID的当前记录?
- C#能很好地开发象QQ,竞开协同办公这样的程序吗?
- 我有个登录form有个MainForm想在MainForm打开前,先打开登陆Form,但是我如何把登陆后的信息传给MainForm
- 如何获取和重写服务器控件的DataSource
- 对于有嵌套的结构体,怎么遍历所以的数据呢?
- 只学C#,也要买七张光盘吗?哪里有邮购的?
- 大家用了这么久的C#,现在感觉怎么样了?
- 如何取得在DataGrid中所选择的记录里的某个字段
已经说明了我会用System.IO.Directory的方法,这点您不用再说了。我也知道用递归是慢的主要原因,不然我就不用在问题里特意告诉你了。
“两层while循环代替递归调用”的方法我不会,你写写代码来让我学学?