1. 获取指定目录下所有的文件全路径:
public IEnumerable<String> GetFiles(string dir)
{
foreach (String file in System.IO.Directory.GetFiles(dir, "*.*", System.IO.SearchOption.AllDirectories)) {
yield return file;
}
{
foreach (String file in System.IO.Directory.GetFiles(dir, "*.*", System.IO.SearchOption.AllDirectories)) {
yield return file;
}
}