Method FileExists
FileExists(string?)
Gets whether the specified file exists.
public virtual bool FileExists(string? path)
Parameters
pathstringThe file to check.
Returns
- bool
trueif the caller has the required permissions and path contains the name of an existing file; otherwise,false. Also returnsfalseif 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 returnsfalseregardless of the existence of file.