UtilFileGetFilePaths(String, SearchOption, IEnumerableString, IEnumerableString, Boolean, Boolean) Method
Gets the filepaths those matches the criteria inside the specified directory and/or sub-directories.
Namespace: DevCase.Core.IO.FileSystemAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static IEnumerable<string> GetFilePaths(
string dirPath,
SearchOption searchOption,
IEnumerable<string> fileNamePatterns = null,
IEnumerable<string> fileExtPatterns = null,
bool ignoreCase = true,
bool throwOnError = false
)
Public Shared Function GetFilePaths (
dirPath As String,
searchOption As SearchOption,
Optional fileNamePatterns As IEnumerable(Of String) = Nothing,
Optional fileExtPatterns As IEnumerable(Of String) = Nothing,
Optional ignoreCase As Boolean = true,
Optional throwOnError As Boolean = false
) As IEnumerable(Of String)
Dim dirPath As String
Dim searchOption As SearchOption
Dim fileNamePatterns As IEnumerable(Of String)
Dim fileExtPatterns As IEnumerable(Of String)
Dim ignoreCase As Boolean
Dim throwOnError As Boolean
Dim returnValue As IEnumerable(Of String)
returnValue = UtilFile.GetFilePaths(dirPath,
searchOption, fileNamePatterns,
fileExtPatterns, ignoreCase, throwOnError)
public:
static IEnumerable<String^>^ GetFilePaths(
String^ dirPath,
SearchOption searchOption,
IEnumerable<String^>^ fileNamePatterns = nullptr,
IEnumerable<String^>^ fileExtPatterns = nullptr,
bool ignoreCase = true,
bool throwOnError = false
)
static member GetFilePaths :
dirPath : string *
searchOption : SearchOption *
?fileNamePatterns : IEnumerable<string> *
?fileExtPatterns : IEnumerable<string> *
?ignoreCase : bool *
?throwOnError : bool
(* Defaults:
let _fileNamePatterns = defaultArg fileNamePatterns null
let _fileExtPatterns = defaultArg fileExtPatterns null
let _ignoreCase = defaultArg ignoreCase true
let _throwOnError = defaultArg throwOnError false
*)
-> IEnumerable<string>
No code example is currently available or this language may not be supported.
- dirPath String
-
The root directory path to search for files.
- searchOption SearchOption
-
The searching mode.
- fileNamePatterns IEnumerableString (Optional)
-
The file name pattern(s) to match.
- fileExtPatterns IEnumerableString (Optional)
-
The file extension pattern(s) to match.
- ignoreCase Boolean (Optional)
-
If , ignores the comparing case of fileNamePatterns and fileExtPatterns patterns.
- throwOnError Boolean (Optional)
-
If set to , exceptions will be thrown, like access denied to file or directory.
IEnumerableString
An
IEnumerableT instance containing the filepaths.
This is a code example.
No code example is currently available or this language may not be supported.
Dim filePaths As List(Of String) =
GetFilePaths("C:\Windows\System32", SearchOption.AllDirectories).ToList
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ArgumentException
|
dirPath or searchOption
|