{
return Directory.GetFiles(dir, "*", SearchOption.AllDirectories).ToList();
}
//
// Summary:
// Returns the names of files (including their paths) that match the specified search
// pattern in the specified directory, using a value to determine whether to search
// subdirectories.
//
// Parameters:
// path:
// The relative or absolute path to the directory to search. This string is not
// case-sensitive.
//
// searchPattern:
// The search string to match against the names of files in path. This parameter
// can contain a combination of valid literal path and wildcard (* and ?) characters
// (see Remarks), but doesn't support regular expressions.
//
// searchOption:
// One of the enumeration values that specifies whether the search operation should
// include all subdirectories or only the current directory.
//
// Returns:
// An array of the full names (including paths) for the files in the specified directory
// that match the specified search pattern and option, or an empty array if no files
// are found.
//
// Exceptions:
// T:System.ArgumentException:
// path is a zero-length string, contains only white space, or contains one or more
// invalid characters. You can query for invalid characters with the System.IO.Path.GetInvalidPathChars
// method. -or- searchPattern does not contain a valid pattern.
//
// T:System.ArgumentNullException:
// path or searchpattern is null.
//
// T:System.ArgumentOutOfRangeException:
// searchOption is not a valid System.IO.SearchOption value.
//
// T:System.UnauthorizedAccessException:
// The caller does not have the required permission.
//
// T:System.IO.DirectoryNotFoundException:
// The specified path is not found or is invalid (for example, it is on an unmapped
// drive).
//
// T:System.IO.PathTooLongException:
// The specified path, file name, or both exceed the system-defined maximum length.
// For example, on Windows-based platforms, paths must be less than 248 characters
// and file names must be less than 260 characters.
//
// T:System.IO.IOException:
// path is a file name.-or-A network error has occurred.
public static string[] GetFiles(string path, string searchPattern, SearchOption searchOption);