CSharp examples for File IO:File Command
List All Files
using System.Text.RegularExpressions; using System.IO;// w ww . jav a 2 s . c o m using System.Collections.Generic; using System; public class Main{ private static void ListAllFiles(DirectoryInfo directoryInfo, List<FileInfo> list) { foreach(var subDirectory in directoryInfo.GetDirectories()) { ListAllFiles(subDirectory, list); } foreach (var fileInfo in directoryInfo.GetFiles()) { list.Add(fileInfo); } } }