Method FileExists
FileExists(string?)
Gets whether the specified file exists.
public static bool FileExists(string? path)
Parameters
path
stringThe file to check.
Returns
- bool
true
if the caller has the required permissions and path contains the name of an existing file; otherwise,false
. Also returnsfalse
if path is null, an invalid path, or a zero-length string. If the caller does not have sufficient permissions to read the specified file, no exception is thrown and the method returnsfalse
regardless of the existence of file.