Click or drag to resize
FileExists Method
Determines whether the specified file exists.

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static bool Exists(
	string path
)

Parameters

path
Type: SystemString
The file to check.

Return Value

Type: Boolean
true if the caller has the required permissions and path contains the name of an existing file; otherwise, false. This method also returns false 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 returns false regardless of the existence of path.
See Also