|
FilePathGetFiles(DirectoryInfo, String, SearchOption, ActionException) Method
|
Returns the files that match the specified search pattern in the specified directory, using a value to determine whether to search subdirectories.
Namespace: GSF.IOAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.248-beta+a497a19de709fd99e2448886199a2c8824265ddf
Syntaxpublic static FileInfo[] GetFiles(
DirectoryInfo directory,
string searchPattern = "*",
SearchOption searchOption = SearchOption.AllDirectories,
Action<Exception> exceptionHandler = null
)
Public Shared Function GetFiles (
directory As DirectoryInfo,
Optional searchPattern As String = "*",
Optional searchOption As SearchOption = SearchOption.AllDirectories,
Optional exceptionHandler As Action(Of Exception) = Nothing
) As FileInfo()
public:
static array<FileInfo^>^ GetFiles(
DirectoryInfo^ directory,
String^ searchPattern = L"*",
SearchOption searchOption = SearchOption::AllDirectories,
Action<Exception^>^ exceptionHandler = nullptr
)
static member GetFiles :
directory : DirectoryInfo *
?searchPattern : string *
?searchOption : SearchOption *
?exceptionHandler : Action<Exception>
(* Defaults:
let _searchPattern = defaultArg searchPattern "*"
let _searchOption = defaultArg searchOption SearchOption.AllDirectories
let _exceptionHandler = defaultArg exceptionHandler null
*)
-> FileInfo[]
GSF.IO.FilePath.GetFiles = function(directory, searchPattern, searchOption, exceptionHandler);
View SourceParameters
- directory DirectoryInfo
- The directory to search.
- searchPattern String (Optional)
- The search string to match against the names of files in the directory. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but doesn't support regular expressions.
- searchOption SearchOption (Optional)
- One of the enumeration values that specifies whether the search operation should include all subdirectories or only the current directory.
- exceptionHandler ActionException (Optional)
- Handles exceptions thrown during file enumeration.
Return Value
FileInfoAn array of the
FileInfo objects representing the files in the specified directory that match the specified search pattern, or an empty array if no files are found.
See Also