Example
public static string[] GetFiles(string path, bool recursive)
{
ArrayList fileArrayList = new ArrayList();
DirectoryManager.ValidateDirectoryPath( path);
if (DirectoryManager.Exists(path))
{
fileArrayList.AddRange(Directory.
GetFiles(path));
if (recursive)
{
foreach (string dir in Directory.GetDirectories(path))
{
fileArrayList.AddRange(
DirectoryManager.
GetFiles(dir, recursive));
}
}
}
return (string[])fileArrayList.ToArray(
typeof(string));
}