C# Directory.GetFiles()获取多个类型格式的文件

来源:互联网 发布:淘宝刷钻信誉加qq 编辑:程序博客网 时间:2024/04/28 02:06

第一种方式

System.IO.Directory.GetFiles()获取多个类型格式的文件
System.IO.Directory.GetFiles("c:\","(*.exe|*.txt)"); 

 

 第二种方式

var files = Directory.GetFiles("C:\\path", "*.*", SearchOption.AllDirectories)
.Where(s => s.EndsWith(".mp3") || s.EndsWith(".jpg"));

 

但这种写法应该只有VS2008才支持,VS2005不支持


-------------------------------------------------------------------
请各位网友了解邪淫的危害,远离邪淫


1.玉历宝钞视频(土豆)
http://www.tudou.com/programs/view/nhxOfFOB5Fo/
2.风月场之陷阱
http://www.xuefo.net/nr/article13/130376.html
3.漫谈两性关系
http://wenku.baidu.com/link?url=r6eYr9qbSx6divz1C2xi14A-ZPkN05FBhzFc9KVypzAoCoMk-vuuyM9eFyL_0H7G_MSgKR9SKIyniFwQ-N5bxwonjdXOwn4nURvV5MypY8S
4.戒除邪淫(学佛网)文章
http://www.xuefo.net/ztzl_10.htm
5.邪淫的因果(视频)
http://www.fodizi.com/fofa/list/7906.htm
6.寿康宝鉴(百度文章)
http://baike.baidu.com/link?url=E_DulKa0ERhxxZP6sNMT_2pVjLrta1qIEjPftxPlfjuehFK-NKitLCQPXTYil7ttDqLqLFUltfleNde_P-gSya
-------------------------------------------------------------------

原创粉丝点击