Table of Contents

Method FindFirstFile

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

FindFirstFile(string, string, SearchOption)

Returns the full file name that match a search pattern in a specified path, and optionally searches subdirectories.

public static string? FindFirstFile(string path, string searchPattern, SearchOption searchOption)

Parameters

path string

The relative or absolute path to the directory to search. This string is not case-sensitive.

searchPattern string

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. It doesn't support regular expressions.

searchOption SearchOption

One of the enumeration values that specifies whether the search operation should include only the current directory or should include all subdirectories. The default value is TopDirectoryOnly.

Returns

string

The full name (including path) for the first found file in the directory specified by path and that match the specified search pattern and search option. Returns null if no file was found.