【发布时间】:2011-05-10 03:33:32
【问题描述】:
我正在使用自定义类来存储有关在基于正则表达式的目录中找到的文件的信息,并且我需要从方法中返回这些文件列表。以下是它当前工作方式的一些伪代码:
class FileList {
//propertes of the file here, such as regex name, source folder and whether it needs to be deleted after copying
}
..
..
foreach (file in directory that matches regex)
{
new filelist
//Set all the properties
}
return allfilelists;
但是如何返回所有列表,或者有更好的方法吗?
谢谢
【问题讨论】: