备忘
- string directory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
- List<FileInfo> files = new List<FileInfo>();
- ///获取文件列表信息
- foreach (var file in Directory.GetFiles(directory))
- {
- files.Add(new FileInfo(file));
- }
- ///查询文件列表信息
- var filevalues = from file in files
- where file.Extension == ".pdf" && file.Name.IndexOf("报告") > -1
- orderby file.Name
- select file;
详见如下链接:
http://blog.csdn.net/chinajiyong/article/details/7481969